Skip to content

Commit

Permalink
Zigbee2mqtt: reset lamp last set brightness when user changes settings
Browse files Browse the repository at this point in the history
  • Loading branch information
awawa-dev committed Jan 2, 2025
1 parent 3628e7a commit 05cb879
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions sources/led-drivers/net/DriverNetHomeAssistant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ bool DriverNetHomeAssistant::init(const QJsonObject& deviceConfig)
auto lampObj = lamp.toObject();
hl.name = lampObj["name"].toString();
hl.colorModel = static_cast<HomeAssistantLamp::Mode>(lampObj["colorModel"].toInt(0));
hl.currentBrightness = _haInstance.constantBrightness;
Debug(_log, "Configured lamp (%s) : %s", (hl.colorModel == 0) ? "RGB" : "HSV", QSTRING_CSTR(hl.name));
_haInstance.lamps.push_back(hl);
}
Expand Down
1 change: 1 addition & 0 deletions sources/led-drivers/net/DriverNetZigbee2mqtt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ bool DriverNetZigbee2mqtt::init(const QJsonObject& deviceConfig)
auto lampObj = lamp.toObject();
hl.name = lampObj["name"].toString();
hl.colorModel = static_cast<Zigbee2mqttLamp::Mode>(lampObj["colorModel"].toInt(0));
hl.currentBrightness = _zigInstance.constantBrightness;
Debug(_log, "Configured lamp (%s) : %s", (hl.colorModel == 0) ? "RGB" : "HSV", QSTRING_CSTR(hl.name));
_zigInstance.lamps.push_back(hl);
}
Expand Down

0 comments on commit 05cb879

Please sign in to comment.