fix hs105 mac to pass the test, wrap sysinfo_lb110 properly inside 'system'

This commit is contained in:
Teemu Rytilahti 2017-08-05 17:21:23 +02:00
parent 92c9cddfd4
commit 5839c2d1de

View File

@ -71,7 +71,7 @@ sysinfo_hs105 = {'system': {'get_sysinfo':
{'sw_ver': '1.0.6 Build 160722 Rel.081616', {'sw_ver': '1.0.6 Build 160722 Rel.081616',
'hw_ver': '1.0', 'type': 'IOT.SMARTPLUGSWITCH', 'hw_ver': '1.0', 'type': 'IOT.SMARTPLUGSWITCH',
'model': 'HS105(US)', 'model': 'HS105(US)',
'mac': '50:C7:BF:xx:xx:xx', 'mac': '50:C7:BF:11:22:33',
'dev_name': 'Smart Wi-Fi Plug Mini', 'dev_name': 'Smart Wi-Fi Plug Mini',
'alias': 'TP-LINK_Smart Plug_CF0B', 'alias': 'TP-LINK_Smart Plug_CF0B',
'relay_state': 0, 'relay_state': 0,
@ -198,70 +198,72 @@ sysinfo_lb130 = {'system': {'get_sysinfo':
'smartlife.iot.common.emeter': emeter_units_support, 'smartlife.iot.common.emeter': emeter_units_support,
} }
sysinfo_lb110 = {'sys_info': {'emeter': sysinfo_lb110 = {'system': {
{'err_code': -2001, 'sys_info':
'err_msg': 'Module not support'}, {'emeter':
'system': {'err_code': -2001,
{'get_sysinfo': 'err_msg': 'Module not support'},
{'active_mode': 'schedule', 'system':
'alias': 'Downstairs Light', {'get_sysinfo':
'ctrl_protocols': {'active_mode': 'schedule',
{'name': 'Linkie', 'alias': 'Downstairs Light',
'version': '1.0'}, 'ctrl_protocols':
'description': 'Smart Wi-Fi LED Bulb ' {'name': 'Linkie',
'with Dimmable Light', 'version': '1.0'},
'dev_state': 'normal', 'description': 'Smart Wi-Fi LED Bulb '
'deviceId': 'with Dimmable Light',
'80120B3D03E0B639CDF33E3CB1466490187FEF32', 'dev_state': 'normal',
'disco_ver': '1.0', 'deviceId':
'err_code': 0, '80120B3D03E0B639CDF33E3CB1466490187FEF32',
'heapsize': 309908, 'disco_ver': '1.0',
'hwId': '111E35908497A05512E259BB76801E10', 'err_code': 0,
'hw_ver': '1.0', 'heapsize': 309908,
'is_color': 0, 'hwId': '111E35908497A05512E259BB76801E10',
'is_dimmable': 1, 'hw_ver': '1.0',
'is_factory': False, 'is_color': 0,
'is_variable_color_temp': 0, 'is_dimmable': 1,
'light_state': 'is_factory': False,
{'dft_on_state': 'is_variable_color_temp': 0,
{'brightness': 92, 'light_state':
'color_temp': 2700, {'dft_on_state':
'hue': 0, {'brightness': 92,
'mode': 'normal', 'color_temp': 2700,
'saturation': 0}, 'hue': 0,
'on_off': 0}, 'mode': 'normal',
'mic_mac': '50C7BF7BE306', 'saturation': 0},
'mic_type': 'IOT.SMARTBULB', 'on_off': 0},
'model': 'LB110(EU)', 'mic_mac': '50C7BF7BE306',
'oemId': 'mic_type': 'IOT.SMARTBULB',
'A68E15472071CB761E5CCFB388A1D8AE', 'model': 'LB110(EU)',
'preferred_state': [{'brightness': 100, 'oemId':
'color_temp': 2700, 'A68E15472071CB761E5CCFB388A1D8AE',
'hue': 0, 'preferred_state': [{'brightness': 100,
'index': 0, 'color_temp': 2700,
'saturation': 0}, 'hue': 0,
{'brightness': 58, 'index': 0,
'color_temp': 2700, 'saturation': 0},
'hue': 0, {'brightness': 58,
'index': 1, 'color_temp': 2700,
'saturation': 0}, 'hue': 0,
{'brightness': 25, 'index': 1,
'color_temp': 2700, 'saturation': 0},
'hue': 0, {'brightness': 25,
'index': 2, 'color_temp': 2700,
'saturation': 0}, 'hue': 0,
{'brightness': 1, 'index': 2,
'color_temp': 2700, 'saturation': 0},
'hue': 0, {'brightness': 1,
'index': 3, 'color_temp': 2700,
'saturation': 0}], 'hue': 0,
'rssi': -61, 'index': 3,
'sw_ver': '1.5.5 Build 170623 ' 'saturation': 0}],
'Rel.090105' 'rssi': -61,
} 'sw_ver': '1.5.5 Build 170623 '
} 'Rel.090105'
} }
} }
}
}}
def error(cls, target, cmd="no-command", msg="default msg"): def error(cls, target, cmd="no-command", msg="default msg"):
return {target: {cmd: {"err_code": -1323, "msg": msg}}} return {target: {cmd: {"err_code": -1323, "msg": msg}}}