mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 15:59:52 +03:00
formatting
This commit is contained in:
@@ -988,7 +988,7 @@ void Mqtt::publish_ha_sensor_config(uint8_t type,
|
|||||||
// create the topic, depending on the type and whether the device entity is writable (a command)
|
// create the topic, depending on the type and whether the device entity is writable (a command)
|
||||||
// https://developers.home-assistant.io/docs/core/entity
|
// https://developers.home-assistant.io/docs/core/entity
|
||||||
char topic[MQTT_TOPIC_MAX_SIZE];
|
char topic[MQTT_TOPIC_MAX_SIZE];
|
||||||
// if it's a command then we can use Number, Switch. Otherwise stick to Sensor
|
// if it's a command then we can use Number, Switch, Select. Otherwise stick to Sensor
|
||||||
if (has_cmd) {
|
if (has_cmd) {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case DeviceValueType::INT:
|
case DeviceValueType::INT:
|
||||||
@@ -996,13 +996,13 @@ void Mqtt::publish_ha_sensor_config(uint8_t type,
|
|||||||
case DeviceValueType::SHORT:
|
case DeviceValueType::SHORT:
|
||||||
case DeviceValueType::USHORT:
|
case DeviceValueType::USHORT:
|
||||||
case DeviceValueType::ULONG:
|
case DeviceValueType::ULONG:
|
||||||
// number - https://www.home-assistant.io/integrations/number.mqtt/
|
// number - https://www.home-assistant.io/integrations/number.mqtt
|
||||||
// https://developers.home-assistant.io/docs/core/entity/number
|
// https://developers.home-assistant.io/docs/core/entity/number
|
||||||
|
|
||||||
snprintf(topic, sizeof(topic), "number/%s/%s/config", mqtt_base_.c_str(), uniq);
|
snprintf(topic, sizeof(topic), "number/%s/%s/config", mqtt_base_.c_str(), uniq);
|
||||||
break;
|
break;
|
||||||
case DeviceValueType::BOOL:
|
case DeviceValueType::BOOL:
|
||||||
// switch - https://www.home-assistant.io/integrations/switch.mqtt/
|
// switch - https://www.home-assistant.io/integrations/switch.mqtt
|
||||||
snprintf(topic, sizeof(topic), "switch/%s/%s/config", mqtt_base_.c_str(), uniq);
|
snprintf(topic, sizeof(topic), "switch/%s/%s/config", mqtt_base_.c_str(), uniq);
|
||||||
break;
|
break;
|
||||||
case DeviceValueType::ENUM:
|
case DeviceValueType::ENUM:
|
||||||
|
|||||||
@@ -208,7 +208,7 @@ void WebCustomizationService::device_entities(AsyncWebServerRequest * request, J
|
|||||||
request->send(response);
|
request->send(response);
|
||||||
}
|
}
|
||||||
|
|
||||||
// takes a list of masked ids send from the webUI
|
// takes a list of masked ids sent from the webUI
|
||||||
// saves it in the customization service
|
// saves it in the customization service
|
||||||
// and updates the entity list real-time
|
// and updates the entity list real-time
|
||||||
void WebCustomizationService::masked_entities(AsyncWebServerRequest * request, JsonVariant & json) {
|
void WebCustomizationService::masked_entities(AsyncWebServerRequest * request, JsonVariant & json) {
|
||||||
|
|||||||
Reference in New Issue
Block a user