diff --git a/src/pyatmo/modules/device_types.py b/src/pyatmo/modules/device_types.py index 042dfbfa..7c823c84 100644 --- a/src/pyatmo/modules/device_types.py +++ b/src/pyatmo/modules/device_types.py @@ -15,9 +15,6 @@ class DeviceType(str, Enum): # temporarily disable locally-disabled and locally-enabled # pylint: disable=C0103 - # Unknown - UNKNOWN = "UNKNOWN" - # Climate/Energy NAPlug = "NAPlug" # Smart thermostat gateway NATherm1 = "NATherm1" # Smart thermostat diff --git a/src/pyatmo/modules/module.py b/src/pyatmo/modules/module.py index 0e52befc..95a94713 100644 --- a/src/pyatmo/modules/module.py +++ b/src/pyatmo/modules/module.py @@ -660,11 +660,7 @@ def __init__(self, home: Home, module: ModuleT) -> None: super().__init__(module) - try: - self.device_type = DeviceType(module["type"]) - except ValueError: - LOG.error("Unknown device type %s", module["type"]) - self.device_type = DeviceType.UNKNOWN + self.device_type = DeviceType(module["type"]) self.home = home self.room_id = module.get("room_id") diff --git a/tests/test_pyatmo_refactor.py b/tests/test_pyatmo_refactor.py index 05c0c885..956f5cb7 100644 --- a/tests/test_pyatmo_refactor.py +++ b/tests/test_pyatmo_refactor.py @@ -1128,3 +1128,10 @@ async def test_historical_data_retrieval(async_account): "endTime": "2022-02-12T08:29:49Z", } assert len(module.historical_data) == 168 + + +def test_device_types_missing(): + """Test handling of missing device types.""" + + assert DeviceType("NOC") == DeviceType.NOC + assert DeviceType("UNKNOWN") == DeviceType.NLunknown