From f69074bdc977d2a7a4b3a8b325801206fa9b6ded Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=85ke=20S=20-=20Piper?= Date: Wed, 18 Sep 2024 15:19:31 +0000 Subject: [PATCH] Log warnings for unsupported appliance types --- custom_components/miele/__init__.py | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/custom_components/miele/__init__.py b/custom_components/miele/__init__.py index af7db4bb..52647581 100644 --- a/custom_components/miele/__init__.py +++ b/custom_components/miele/__init__.py @@ -48,6 +48,7 @@ DOMAIN, MANUFACTURER, VERSION, + MieleAppliance, ) from .devcap import ( # noqa: F401 TEST_ACTION_19, @@ -179,7 +180,24 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: _LOGGER.warning("No devices found in API for this account") else: _LOGGER.debug("Miele devices in API account: %s", serialnumbers) - + for appliance in coordinator.data.values(): + if appliance["ident|type|value_raw"] in [ + MieleAppliance.DISHWASHER_SEMI_PROFESSIONAL, + MieleAppliance.DISHWASHER_PROFESSIONAL, + MieleAppliance.WASHING_MACHINE_PROFESSIONAL, + MieleAppliance.WASHING_MACHINE_SEMI_PROFESSIONAL, + MieleAppliance.DRYER_PROFESSIONAL, + MieleAppliance.TUMBLE_DRYER_SEMI_PROFESSIONAL, + ]: + _LOGGER.warning( + "Appliances in (semi-)professional series are not supported by Miele 3rd party API (Type: %s)", + appliance["ident|type|value_raw"], + ) + if appliance["ident|type|value_raw"] not in MieleAppliance: + _LOGGER.warning( + "Appliance type %s is not supported by integration", + appliance["ident|type|value_raw"], + ) miele_api = hass.data[DOMAIN][entry.entry_id][API] for serial in serialnumbers: try: