diff --git a/pyHS100/tests/fakes.py b/pyHS100/tests/fakes.py index af99295e..e6f4c889 100644 --- a/pyHS100/tests/fakes.py +++ b/pyHS100/tests/fakes.py @@ -342,6 +342,61 @@ sysinfo_lb110 = {'system': { } }} +sysinfo_lb120 = {'system': + {'sys_info': + {'system': + {'get_sysinfo': + {'active_mode': 'none', + 'alias': 'LB1202', + 'ctrl_protocols': {'name': 'Linkie', 'version': '1.0'}, + 'description': 'Smart Wi-Fi LED Bulb with Tunable White Light', + 'dev_state': 'normal', + 'deviceId': 'foo', + 'disco_ver': '1.0', + 'heapsize': 329032, + 'hwId': 'foo', + 'hw_ver': '1.0', + 'is_color': 0, + 'is_dimmable': 1, + 'is_factory': False, + 'is_variable_color_temp': 1, + 'light_state': {'dft_on_state': {'brightness': 31, + 'color_temp': 4100, + 'hue': 0, + 'mode': 'normal', + 'saturation': 0}, + 'on_off': 0}, + 'mic_mac': '50C7BF33937C', + 'mic_type': 'IOT.SMARTBULB', + 'model': 'LB120(US)', + 'oemId': 'foo', + 'preferred_state': [{'brightness': 100, + 'color_temp': 3500, + 'hue': 0, + 'index': 0, + 'saturation': 0}, + {'brightness': 50, + 'color_temp': 6500, + 'hue': 0, + 'index': 1, + 'saturation': 0}, + {'brightness': 50, + 'color_temp': 2700, + 'hue': 0, + 'index': 2, + 'saturation': 0}, + {'brightness': 1, + 'color_temp': 2700, + 'hue': 0, + 'index': 3, + 'saturation': 0}], + 'rssi': -47, + 'sw_ver': '1.4.3 Build 170504 Rel.144921'} + } + } + } + } + def error(cls, target, cmd="no-command", msg="default msg"): return {target: {cmd: {"err_code": -1323, "msg": msg}}} diff --git a/pyHS100/tests/test_bulb.py b/pyHS100/tests/test_bulb.py index d3769961..6dcf0ee4 100644 --- a/pyHS100/tests/test_bulb.py +++ b/pyHS100/tests/test_bulb.py @@ -4,7 +4,8 @@ from functools import partial from .. import SmartBulb, SmartDeviceException from .fakes import (FakeTransportProtocol, - sysinfo_lb100, sysinfo_lb110, sysinfo_lb130) + sysinfo_lb100, sysinfo_lb110, + sysinfo_lb120, sysinfo_lb130) BULB_IP = '192.168.250.186' SKIP_STATE_TESTS = False @@ -196,3 +197,7 @@ class TestSmartBulbLB100(TestSmartBulb): class TestSmartBulbLB110(TestSmartBulb): SYSINFO = sysinfo_lb110 + + +class TestSmartBulbLB120(TestSmartBulb): + SYSINFO = sysinfo_lb120