diff --git a/usermods/PIR_sensor_switch/usermod_PIR_sensor_switch.h b/usermods/PIR_sensor_switch/usermod_PIR_sensor_switch.h index 11277593..7124552b 100644 --- a/usermods/PIR_sensor_switch/usermod_PIR_sensor_switch.h +++ b/usermods/PIR_sensor_switch/usermod_PIR_sensor_switch.h @@ -87,8 +87,6 @@ private: static const char _name[]; static const char _switchOffDelay[]; static const char _enabled[]; - static const char _active[]; - static const char _inactive[]; /** * return or change if new PIR sensor state is available @@ -126,7 +124,7 @@ private: void publishMqtt(const char* state) { //Check if MQTT Connected, otherwise it will crash the 8266 - if (mqtt != nullptr){ + if (WLED_MQTT_CONNECTED){ char subuf[64]; strcpy(subuf, mqttDeviceTopic); strcat_P(subuf, PSTR("/motion")); @@ -229,12 +227,10 @@ public: */ void addToJsonInfo(JsonObject &root) { - //this code adds "u":{"⏲ PIR sensor state":uiDomString} to the info object - // the value contains a button to toggle the sensor enabled/disabled JsonObject user = root["u"]; if (user.isNull()) user = root.createNestedObject("u"); - +/* JsonArray infoArr = user.createNestedArray(F(" PIR sensor state")); //name String uiDomString = F("