mirror of
https://github.com/Threnklyn/esphome-dev.git
synced 2026-06-01 02:28:28 +02:00
Add a datapoint to sync the Tuya MCU minimum brightness (#1347)
The Tuya MCU keeps its own internal minimum brightness setting. This value may not match the minimum brightness setting for ESPHome, leading to some issues: 1. Dimming is limited--on some devices the default minimum is as high as 10%, meaning the dimmest ESPHome will go is still quite bright. 2. HA will allow a user to set a value below the MCU minimum, but the MCU will reject it and keep the previous setting, so the UI is confusing. This PR adds a setting to configure the datapoint for setting the MCU minimum brightness. If the setting is set, then ESPHome will synchronize the MCU's minimum brightness with the one configured for ESPHome on startup.
This commit is contained in:
@@ -21,6 +21,13 @@ void TuyaLight::setup() {
|
||||
call.perform();
|
||||
});
|
||||
}
|
||||
if (min_value_datapoint_id_.has_value()) {
|
||||
TuyaDatapoint datapoint{};
|
||||
datapoint.id = *this->min_value_datapoint_id_;
|
||||
datapoint.type = TuyaDatapointType::INTEGER;
|
||||
datapoint.value_int = this->min_value_;
|
||||
parent_->set_datapoint_value(datapoint);
|
||||
}
|
||||
}
|
||||
|
||||
void TuyaLight::dump_config() {
|
||||
|
||||
Reference in New Issue
Block a user