forked from platypush/platypush
Fixed zigbee.mqtt light entity conversion
This commit is contained in:
parent
636d1ced3a
commit
d5f8d55b4b
1 changed files with 7 additions and 7 deletions
|
@ -201,7 +201,7 @@ class ZigbeeMqttPlugin(MqttPlugin): # lgtm [py/missing-call-to-init]
|
||||||
if light_info:
|
if light_info:
|
||||||
compatible_entities.append(
|
compatible_entities.append(
|
||||||
Light(
|
Light(
|
||||||
id=f'{dev["ieee_address"]}|light',
|
id=f'{dev["ieee_address"]}:light',
|
||||||
name=dev.get('friendly_name'),
|
name=dev.get('friendly_name'),
|
||||||
on=dev.get('state', {}).get('state')
|
on=dev.get('state', {}).get('state')
|
||||||
== switch_info.get('value_on'),
|
== switch_info.get('value_on'),
|
||||||
|
@ -214,14 +214,14 @@ class ZigbeeMqttPlugin(MqttPlugin): # lgtm [py/missing-call-to-init]
|
||||||
saturation_min=light_info.get('saturation_min'),
|
saturation_min=light_info.get('saturation_min'),
|
||||||
saturation_max=light_info.get('saturation_max'),
|
saturation_max=light_info.get('saturation_max'),
|
||||||
brightness=(
|
brightness=(
|
||||||
dev.get('state', {})
|
dev.get('state', {}).get(
|
||||||
.get('color', {})
|
light_info.get('brightness_name', 'brightness')
|
||||||
.get(light_info.get('brightness_name', 'brightness'))
|
)
|
||||||
),
|
),
|
||||||
temperature=(
|
temperature=(
|
||||||
dev.get('state', {})
|
dev.get('state', {}).get(
|
||||||
.get('color', {})
|
light_info.get('temperature_name', 'temperature')
|
||||||
.get(light_info.get('temperature_name', 'temperature'))
|
)
|
||||||
),
|
),
|
||||||
hue=(
|
hue=(
|
||||||
dev.get('state', {})
|
dev.get('state', {})
|
||||||
|
|
Loading…
Reference in a new issue