mirror of
https://github.com/bahmcloud/HA-KNX-Bridge.git
synced 2026-04-06 16:51:14 +00:00
Add relative color temp control
This commit is contained in:
@@ -1167,7 +1167,7 @@ class BridgeManager:
|
||||
await self._call_light_service(
|
||||
port.entity_id,
|
||||
"turn_on",
|
||||
{"color_temp": _kelvin_to_mireds(kelvin)},
|
||||
{ATTR_COLOR_TEMP_KELVIN: int(round(kelvin))},
|
||||
)
|
||||
return
|
||||
|
||||
@@ -1477,7 +1477,7 @@ class BridgeManager:
|
||||
await self._call_light_service(
|
||||
port.entity_id,
|
||||
"turn_on",
|
||||
{"color_temp": _kelvin_to_mireds(next_kelvin)},
|
||||
{ATTR_COLOR_TEMP_KELVIN: int(round(next_kelvin))},
|
||||
)
|
||||
await asyncio.sleep(0.3)
|
||||
|
||||
@@ -1740,8 +1740,8 @@ def _color_temperature_payload(
|
||||
percent = (kelvin - min_kelvin) / (max_kelvin - min_kelvin) * 100
|
||||
return int(round(_clamp_percent(int(round(percent))))), "percent"
|
||||
if port.color_temperature_mode == "absolute_float":
|
||||
return float(kelvin), "9"
|
||||
return int(round(kelvin)), "7.600"
|
||||
return float(kelvin), "2byte_float"
|
||||
return int(round(kelvin)), "2byte_unsigned"
|
||||
|
||||
|
||||
def _color_temperature_from_value(
|
||||
|
||||
Reference in New Issue
Block a user