Fix data_key of the xiaomi_aqara cover for LAN protocol v2 (#22358)

pull/22397/head
Sebastian Muszynski 2019-03-26 07:46:00 +01:00 committed by Jason Hu
parent 79445a7ccc
commit 6fa8fdf555
1 changed files with 5 additions and 1 deletions

View File

@ -17,8 +17,12 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
for device in gateway.devices['cover']:
model = device['model']
if model == 'curtain':
if 'proto' not in device or int(device['proto'][0:1]) == 1:
data_key = 'status'
else:
data_key = 'curtain_status'
devices.append(XiaomiGenericCover(device, "Curtain",
'status', gateway))
data_key, gateway))
add_entities(devices)