mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 15:59:52 +03:00
changes from https://github.com/proddy/EMS-ESP/pull/451
This commit is contained in:
@@ -63,6 +63,19 @@ function EMSESPSettingsControllerForm(props: EMSESPSettingsControllerFormProps)
|
|||||||
onChange={handleValueChange('tx_mode')}
|
onChange={handleValueChange('tx_mode')}
|
||||||
margin="normal"
|
margin="normal"
|
||||||
/>
|
/>
|
||||||
|
<SelectValidator name="ems_bus_id"
|
||||||
|
label="Bus ID"
|
||||||
|
value={data.ems_bus_id}
|
||||||
|
fullWidth
|
||||||
|
variant="outlined"
|
||||||
|
onChange={handleValueChange('ems_bus_id')}
|
||||||
|
margin="normal">
|
||||||
|
<MenuItem value={0x0B}>Service Key (0x0B)</MenuItem>
|
||||||
|
<MenuItem value={0x0D}>Modem (0x0D)</MenuItem>
|
||||||
|
<MenuItem value={0x0A}>Terminal (0x0A)</MenuItem>
|
||||||
|
<MenuItem value={0x0F}>Time Module (0x0F)</MenuItem>
|
||||||
|
<MenuItem value={0x12}>Alarm Module (0x12)</MenuItem>
|
||||||
|
</SelectValidator>
|
||||||
<BlockFormControlLabel
|
<BlockFormControlLabel
|
||||||
control={
|
control={
|
||||||
<Checkbox
|
<Checkbox
|
||||||
|
|||||||
@@ -22,6 +22,8 @@
|
|||||||
|
|
||||||
namespace emsesp {
|
namespace emsesp {
|
||||||
|
|
||||||
|
using namespace std::placeholders; // for `_1` etc
|
||||||
|
|
||||||
EMSESPDevicesService::EMSESPDevicesService(AsyncWebServer * server, SecurityManager * securityManager)
|
EMSESPDevicesService::EMSESPDevicesService(AsyncWebServer * server, SecurityManager * securityManager)
|
||||||
: _device_dataHandler(DEVICE_DATA_SERVICE_PATH,
|
: _device_dataHandler(DEVICE_DATA_SERVICE_PATH,
|
||||||
securityManager->wrapCallback(std::bind(&EMSESPDevicesService::device_data, this, _1, _2), AuthenticationPredicates::IS_AUTHENTICATED)) {
|
securityManager->wrapCallback(std::bind(&EMSESPDevicesService::device_data, this, _1, _2), AuthenticationPredicates::IS_AUTHENTICATED)) {
|
||||||
@@ -39,7 +41,7 @@ EMSESPDevicesService::EMSESPDevicesService(AsyncWebServer * server, SecurityMana
|
|||||||
}
|
}
|
||||||
|
|
||||||
void EMSESPDevicesService::scan_devices(AsyncWebServerRequest * request) {
|
void EMSESPDevicesService::scan_devices(AsyncWebServerRequest * request) {
|
||||||
EMSESP::send_read_request(EMSdevice::EMS_TYPE_UBADevices, EMSdevice::EMS_DEVICE_ID_BOILER);
|
EMSESP::scan_devices();
|
||||||
request->send(200);
|
request->send(200);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -55,7 +57,7 @@ void EMSESPDevicesService::all_devices(AsyncWebServerRequest * request) {
|
|||||||
obj["type"] = emsdevice->device_type_name();
|
obj["type"] = emsdevice->device_type_name();
|
||||||
obj["brand"] = emsdevice->brand_to_string();
|
obj["brand"] = emsdevice->brand_to_string();
|
||||||
obj["name"] = emsdevice->name();
|
obj["name"] = emsdevice->name();
|
||||||
obj["deviceid"] = emsdevice->device_id();
|
obj["deviceid"] = emsdevice->get_device_id();
|
||||||
obj["productid"] = emsdevice->product_id();
|
obj["productid"] = emsdevice->product_id();
|
||||||
obj["version"] = emsdevice->version();
|
obj["version"] = emsdevice->version();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,8 +24,7 @@
|
|||||||
#include <ESPAsyncWebServer.h>
|
#include <ESPAsyncWebServer.h>
|
||||||
#include <SecurityManager.h>
|
#include <SecurityManager.h>
|
||||||
|
|
||||||
// #define MAX_EMSESP_STATUS_SIZE 1024
|
#define MAX_EMSESP_DEVICE_SIZE 1536
|
||||||
#define MAX_EMSESP_DEVICE_SIZE 1280
|
|
||||||
|
|
||||||
#define EMSESP_DEVICES_SERVICE_PATH "/rest/allDevices"
|
#define EMSESP_DEVICES_SERVICE_PATH "/rest/allDevices"
|
||||||
#define SCAN_DEVICES_SERVICE_PATH "/rest/scanDevices"
|
#define SCAN_DEVICES_SERVICE_PATH "/rest/scanDevices"
|
||||||
@@ -33,8 +32,6 @@
|
|||||||
|
|
||||||
namespace emsesp {
|
namespace emsesp {
|
||||||
|
|
||||||
using namespace std::placeholders; // for `_1`
|
|
||||||
|
|
||||||
class EMSESPDevicesService {
|
class EMSESPDevicesService {
|
||||||
public:
|
public:
|
||||||
EMSESPDevicesService(AsyncWebServer * server, SecurityManager * securityManager);
|
EMSESPDevicesService(AsyncWebServer * server, SecurityManager * securityManager);
|
||||||
|
|||||||
Reference in New Issue
Block a user