Relay publish after any change

This commit is contained in:
Patrick Haßel 2025-09-03 14:31:15 +02:00
parent a3076b9b2f
commit 2652de5cb8

View File

@ -64,56 +64,67 @@ public:
void setName(const String &value) override { void setName(const String &value) override {
Output::setName(value); Output::setName(value);
storeString(path("name"), nameFallback, value); storeString(path("name"), nameFallback, value);
publish();
} }
void setInitial(const Initial value) override { void setInitial(const Initial value) override {
Output::setInitial(value); Output::setInitial(value);
storeInitial(path("initial"), INITIAL_OFF, value); storeInitial(path("initial"), INITIAL_OFF, value);
publish();
} }
void setOnMillis(const unsigned long value) override { void setOnMillis(const unsigned long value) override {
Output::setOnMillis(value); Output::setOnMillis(value);
storeLong(path("onMillis"), 0L, value); storeLong(path("onMillis"), 0L, value);
publish();
} }
void setOffMillis(const unsigned long value) override { void setOffMillis(const unsigned long value) override {
Output::setOffMillis(value); Output::setOffMillis(value);
storeLong(path("offMillis"), 0L, value); storeLong(path("offMillis"), 0L, value);
publish();
} }
void setTopic(const String &value) { void setTopic(const String &value) {
topic = value; topic = value;
storeString(path("topic"), topicFallback, value); storeString(path("topic"), topicFallback, value);
publish();
} }
void setGridPowerDeltaOnEnabled(const bool value) { void setGridPowerDeltaOnEnabled(const bool value) {
gridPowerDeltaOnEnabled = value; gridPowerDeltaOnEnabled = value;
storeBool(path("gridPowerDeltaOnEnabled"), false, value); storeBool(path("gridPowerDeltaOnEnabled"), false, value);
publish();
} }
void setGridPowerDeltaOnThreshold(const long value) { void setGridPowerDeltaOnThreshold(const long value) {
gridPowerDeltaOnThreshold = value; gridPowerDeltaOnThreshold = value;
storeLong(path("gridPowerDeltaOnThreshold"), 0L, value); storeLong(path("gridPowerDeltaOnThreshold"), 0L, value);
publish();
} }
void setGridPowerDeltaOnDelay(const long value) { void setGridPowerDeltaOnDelay(const long value) {
gridPowerDeltaOnDelay = value; gridPowerDeltaOnDelay = value;
storeLong(path("gridPowerDeltaOnDelay"), 0L, value); storeLong(path("gridPowerDeltaOnDelay"), 0L, value);
publish();
} }
void setGridPowerDeltaOffEnabled(const bool value) { void setGridPowerDeltaOffEnabled(const bool value) {
gridPowerDeltaOffEnabled = value; gridPowerDeltaOffEnabled = value;
storeBool(path("gridPowerDeltaOffEnabled"), false, value); storeBool(path("gridPowerDeltaOffEnabled"), false, value);
publish();
} }
void setGridPowerDeltaOffThreshold(const long value) { void setGridPowerDeltaOffThreshold(const long value) {
gridPowerDeltaOffThreshold = value; gridPowerDeltaOffThreshold = value;
storeLong(path("gridPowerDeltaOffThreshold"), 0L, value); storeLong(path("gridPowerDeltaOffThreshold"), 0L, value);
publish();
} }
void setGridPowerDeltaOffDelay(const long value) { void setGridPowerDeltaOffDelay(const long value) {
gridPowerDeltaOffDelay = value; gridPowerDeltaOffDelay = value;
storeLong(path("gridPowerDeltaOffDelay"), 0L, value); storeLong(path("gridPowerDeltaOffDelay"), 0L, value);
publish();
} }
void json(const JsonObject json) const { void json(const JsonObject json) const {