diff --git a/tests/__init__.py b/tests/__init__.py index 89334f7b..e2dffa26 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -46,7 +46,7 @@ def init(device: dict, config: dict = None) -> (XRegistry, List[XEntity]): reg.dispatcher_connect(SIGNAL_ADD_ENTITIES, lambda x: entities.extend(x)) entities += reg.setup_devices(devices) - hass = HomeAssistant() + hass = HomeAssistant("") for entity in entities: if not isinstance(entity, Entity): continue diff --git a/tests/test_entity.py b/tests/test_entity.py index 1a0e93da..fee5eec8 100644 --- a/tests/test_entity.py +++ b/tests/test_entity.py @@ -1588,6 +1588,8 @@ def test_minir4(): ], "addSubDevState": "off", "addTimeOut": 10, + + "key": 0, # added manually }, "model": "MINIR4", } @@ -1599,6 +1601,12 @@ def test_minir4(): switch: SwitchEntity = next(e for e in entities if e.uid == "detach") assert switch.state == "on" + action: XRemoteButton = next(e for e in entities if e.uid == "action") + assert action.state == "" + + action.internal_update({"key": 0}) + assert action.state == "single" + def test_t5(): entities = get_entitites(