mirror of
https://github.com/home-assistant/core.git
synced 2025-07-27 07:07:28 +00:00
Tiny Home Connect tweaks (#141403)
This commit is contained in:
parent
56a8c74e87
commit
f3bcb96b41
@ -155,7 +155,7 @@ class HomeConnectCoordinator(
|
|||||||
f"home_connect-events_listener_task-{self.config_entry.entry_id}",
|
f"home_connect-events_listener_task-{self.config_entry.entry_id}",
|
||||||
)
|
)
|
||||||
|
|
||||||
async def _event_listener(self) -> None: # noqa: C901
|
async def _event_listener(self) -> None:
|
||||||
"""Match event with listener for event type."""
|
"""Match event with listener for event type."""
|
||||||
retry_time = 10
|
retry_time = 10
|
||||||
while True:
|
while True:
|
||||||
@ -279,13 +279,6 @@ class HomeConnectCoordinator(
|
|||||||
)
|
)
|
||||||
break
|
break
|
||||||
|
|
||||||
# Trigger to delete the possible depaired device entities
|
|
||||||
# from known_entities variable at common.py
|
|
||||||
for listener, context in self._special_listeners.values():
|
|
||||||
assert isinstance(context, tuple)
|
|
||||||
if EventKey.BSH_COMMON_APPLIANCE_DEPAIRED in context:
|
|
||||||
listener()
|
|
||||||
|
|
||||||
@callback
|
@callback
|
||||||
def _call_event_listener(self, event_message: EventMessage) -> None:
|
def _call_event_listener(self, event_message: EventMessage) -> None:
|
||||||
"""Call listener for event."""
|
"""Call listener for event."""
|
||||||
@ -389,6 +382,13 @@ class HomeConnectCoordinator(
|
|||||||
remove_config_entry_id=self.config_entry.entry_id,
|
remove_config_entry_id=self.config_entry.entry_id,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Trigger to delete the possible depaired device entities
|
||||||
|
# from known_entities variable at common.py
|
||||||
|
for listener, context in self._special_listeners.values():
|
||||||
|
assert isinstance(context, tuple)
|
||||||
|
if EventKey.BSH_COMMON_APPLIANCE_DEPAIRED in context:
|
||||||
|
listener()
|
||||||
|
|
||||||
async def _get_appliance_data(
|
async def _get_appliance_data(
|
||||||
self,
|
self,
|
||||||
appliance: HomeAppliance,
|
appliance: HomeAppliance,
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""Provides number enties for Home Connect."""
|
"""Provides number entities for Home Connect."""
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
from typing import cast
|
from typing import cast
|
||||||
|
@ -53,7 +53,7 @@ BSH_PROGRAM_SENSORS = (
|
|||||||
device_class=SensorDeviceClass.TIMESTAMP,
|
device_class=SensorDeviceClass.TIMESTAMP,
|
||||||
translation_key="program_finish_time",
|
translation_key="program_finish_time",
|
||||||
appliance_types=(
|
appliance_types=(
|
||||||
"CoffeMaker",
|
"CoffeeMaker",
|
||||||
"CookProcessor",
|
"CookProcessor",
|
||||||
"Dishwasher",
|
"Dishwasher",
|
||||||
"Dryer",
|
"Dryer",
|
||||||
@ -194,30 +194,6 @@ SENSORS = (
|
|||||||
)
|
)
|
||||||
|
|
||||||
EVENT_SENSORS = (
|
EVENT_SENSORS = (
|
||||||
HomeConnectSensorEntityDescription(
|
|
||||||
key=EventKey.REFRIGERATION_FRIDGE_FREEZER_EVENT_DOOR_ALARM_FREEZER,
|
|
||||||
device_class=SensorDeviceClass.ENUM,
|
|
||||||
options=EVENT_OPTIONS,
|
|
||||||
default_value="off",
|
|
||||||
translation_key="freezer_door_alarm",
|
|
||||||
appliance_types=("FridgeFreezer", "Freezer"),
|
|
||||||
),
|
|
||||||
HomeConnectSensorEntityDescription(
|
|
||||||
key=EventKey.REFRIGERATION_FRIDGE_FREEZER_EVENT_DOOR_ALARM_REFRIGERATOR,
|
|
||||||
device_class=SensorDeviceClass.ENUM,
|
|
||||||
options=EVENT_OPTIONS,
|
|
||||||
default_value="off",
|
|
||||||
translation_key="refrigerator_door_alarm",
|
|
||||||
appliance_types=("FridgeFreezer", "Refrigerator"),
|
|
||||||
),
|
|
||||||
HomeConnectSensorEntityDescription(
|
|
||||||
key=EventKey.REFRIGERATION_FRIDGE_FREEZER_EVENT_TEMPERATURE_ALARM_FREEZER,
|
|
||||||
device_class=SensorDeviceClass.ENUM,
|
|
||||||
options=EVENT_OPTIONS,
|
|
||||||
default_value="off",
|
|
||||||
translation_key="freezer_temperature_alarm",
|
|
||||||
appliance_types=("FridgeFreezer", "Freezer"),
|
|
||||||
),
|
|
||||||
HomeConnectSensorEntityDescription(
|
HomeConnectSensorEntityDescription(
|
||||||
key=EventKey.BSH_COMMON_EVENT_PROGRAM_ABORTED,
|
key=EventKey.BSH_COMMON_EVENT_PROGRAM_ABORTED,
|
||||||
device_class=SensorDeviceClass.ENUM,
|
device_class=SensorDeviceClass.ENUM,
|
||||||
@ -274,6 +250,22 @@ EVENT_SENSORS = (
|
|||||||
translation_key="drying_process_finished",
|
translation_key="drying_process_finished",
|
||||||
appliance_types=("Dryer",),
|
appliance_types=("Dryer",),
|
||||||
),
|
),
|
||||||
|
HomeConnectSensorEntityDescription(
|
||||||
|
key=EventKey.DISHCARE_DISHWASHER_EVENT_SALT_NEARLY_EMPTY,
|
||||||
|
device_class=SensorDeviceClass.ENUM,
|
||||||
|
options=EVENT_OPTIONS,
|
||||||
|
default_value="off",
|
||||||
|
translation_key="salt_nearly_empty",
|
||||||
|
appliance_types=("Dishwasher",),
|
||||||
|
),
|
||||||
|
HomeConnectSensorEntityDescription(
|
||||||
|
key=EventKey.DISHCARE_DISHWASHER_EVENT_RINSE_AID_NEARLY_EMPTY,
|
||||||
|
device_class=SensorDeviceClass.ENUM,
|
||||||
|
options=EVENT_OPTIONS,
|
||||||
|
default_value="off",
|
||||||
|
translation_key="rinse_aid_nearly_empty",
|
||||||
|
appliance_types=("Dishwasher",),
|
||||||
|
),
|
||||||
HomeConnectSensorEntityDescription(
|
HomeConnectSensorEntityDescription(
|
||||||
key=EventKey.CONSUMER_PRODUCTS_COFFEE_MAKER_EVENT_BEAN_CONTAINER_EMPTY,
|
key=EventKey.CONSUMER_PRODUCTS_COFFEE_MAKER_EVENT_BEAN_CONTAINER_EMPTY,
|
||||||
device_class=SensorDeviceClass.ENUM,
|
device_class=SensorDeviceClass.ENUM,
|
||||||
@ -434,6 +426,30 @@ EVENT_SENSORS = (
|
|||||||
translation_key="device_calc_n_clean_blockage",
|
translation_key="device_calc_n_clean_blockage",
|
||||||
appliance_types=("CoffeeMaker",),
|
appliance_types=("CoffeeMaker",),
|
||||||
),
|
),
|
||||||
|
HomeConnectSensorEntityDescription(
|
||||||
|
key=EventKey.REFRIGERATION_FRIDGE_FREEZER_EVENT_DOOR_ALARM_FREEZER,
|
||||||
|
device_class=SensorDeviceClass.ENUM,
|
||||||
|
options=EVENT_OPTIONS,
|
||||||
|
default_value="off",
|
||||||
|
translation_key="freezer_door_alarm",
|
||||||
|
appliance_types=("FridgeFreezer", "Freezer"),
|
||||||
|
),
|
||||||
|
HomeConnectSensorEntityDescription(
|
||||||
|
key=EventKey.REFRIGERATION_FRIDGE_FREEZER_EVENT_DOOR_ALARM_REFRIGERATOR,
|
||||||
|
device_class=SensorDeviceClass.ENUM,
|
||||||
|
options=EVENT_OPTIONS,
|
||||||
|
default_value="off",
|
||||||
|
translation_key="refrigerator_door_alarm",
|
||||||
|
appliance_types=("FridgeFreezer", "Refrigerator"),
|
||||||
|
),
|
||||||
|
HomeConnectSensorEntityDescription(
|
||||||
|
key=EventKey.REFRIGERATION_FRIDGE_FREEZER_EVENT_TEMPERATURE_ALARM_FREEZER,
|
||||||
|
device_class=SensorDeviceClass.ENUM,
|
||||||
|
options=EVENT_OPTIONS,
|
||||||
|
default_value="off",
|
||||||
|
translation_key="freezer_temperature_alarm",
|
||||||
|
appliance_types=("FridgeFreezer", "Freezer"),
|
||||||
|
),
|
||||||
HomeConnectSensorEntityDescription(
|
HomeConnectSensorEntityDescription(
|
||||||
key=EventKey.CONSUMER_PRODUCTS_CLEANING_ROBOT_EVENT_EMPTY_DUST_BOX_AND_CLEAN_FILTER,
|
key=EventKey.CONSUMER_PRODUCTS_CLEANING_ROBOT_EVENT_EMPTY_DUST_BOX_AND_CLEAN_FILTER,
|
||||||
device_class=SensorDeviceClass.ENUM,
|
device_class=SensorDeviceClass.ENUM,
|
||||||
@ -490,22 +506,6 @@ EVENT_SENSORS = (
|
|||||||
translation_key="grease_filter_max_saturation_reached",
|
translation_key="grease_filter_max_saturation_reached",
|
||||||
appliance_types=("Hood",),
|
appliance_types=("Hood",),
|
||||||
),
|
),
|
||||||
HomeConnectSensorEntityDescription(
|
|
||||||
key=EventKey.DISHCARE_DISHWASHER_EVENT_SALT_NEARLY_EMPTY,
|
|
||||||
device_class=SensorDeviceClass.ENUM,
|
|
||||||
options=EVENT_OPTIONS,
|
|
||||||
default_value="off",
|
|
||||||
translation_key="salt_nearly_empty",
|
|
||||||
appliance_types=("Dishwasher",),
|
|
||||||
),
|
|
||||||
HomeConnectSensorEntityDescription(
|
|
||||||
key=EventKey.DISHCARE_DISHWASHER_EVENT_RINSE_AID_NEARLY_EMPTY,
|
|
||||||
device_class=SensorDeviceClass.ENUM,
|
|
||||||
options=EVENT_OPTIONS,
|
|
||||||
default_value="off",
|
|
||||||
translation_key="rinse_aid_nearly_empty",
|
|
||||||
appliance_types=("Dishwasher",),
|
|
||||||
),
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -1545,30 +1545,6 @@
|
|||||||
"oven_current_cavity_temperature": {
|
"oven_current_cavity_temperature": {
|
||||||
"name": "Current oven cavity temperature"
|
"name": "Current oven cavity temperature"
|
||||||
},
|
},
|
||||||
"freezer_door_alarm": {
|
|
||||||
"name": "Freezer door alarm",
|
|
||||||
"state": {
|
|
||||||
"off": "[%key:common::state::off%]",
|
|
||||||
"confirmed": "[%key:component::home_connect::common::confirmed%]",
|
|
||||||
"present": "[%key:component::home_connect::common::present%]"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"refrigerator_door_alarm": {
|
|
||||||
"name": "Refrigerator door alarm",
|
|
||||||
"state": {
|
|
||||||
"off": "[%key:common::state::off%]",
|
|
||||||
"confirmed": "[%key:component::home_connect::common::confirmed%]",
|
|
||||||
"present": "[%key:component::home_connect::common::present%]"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"freezer_temperature_alarm": {
|
|
||||||
"name": "Freezer temperature alarm",
|
|
||||||
"state": {
|
|
||||||
"off": "[%key:common::state::off%]",
|
|
||||||
"confirmed": "[%key:component::home_connect::common::confirmed%]",
|
|
||||||
"present": "[%key:component::home_connect::common::present%]"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"program_aborted": {
|
"program_aborted": {
|
||||||
"name": "Program aborted",
|
"name": "Program aborted",
|
||||||
"state": {
|
"state": {
|
||||||
@ -1617,6 +1593,22 @@
|
|||||||
"present": "[%key:component::home_connect::common::present%]"
|
"present": "[%key:component::home_connect::common::present%]"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"salt_nearly_empty": {
|
||||||
|
"name": "Salt nearly empty",
|
||||||
|
"state": {
|
||||||
|
"off": "[%key:common::state::off%]",
|
||||||
|
"confirmed": "[%key:component::home_connect::common::confirmed%]",
|
||||||
|
"present": "[%key:component::home_connect::common::present%]"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"rinse_aid_nearly_empty": {
|
||||||
|
"name": "Rinse aid nearly empty",
|
||||||
|
"state": {
|
||||||
|
"off": "[%key:common::state::off%]",
|
||||||
|
"confirmed": "[%key:component::home_connect::common::confirmed%]",
|
||||||
|
"present": "[%key:component::home_connect::common::present%]"
|
||||||
|
}
|
||||||
|
},
|
||||||
"bean_container_empty": {
|
"bean_container_empty": {
|
||||||
"name": "Bean container empty",
|
"name": "Bean container empty",
|
||||||
"state": {
|
"state": {
|
||||||
@ -1777,6 +1769,30 @@
|
|||||||
"present": "[%key:component::home_connect::common::present%]"
|
"present": "[%key:component::home_connect::common::present%]"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"freezer_door_alarm": {
|
||||||
|
"name": "Freezer door alarm",
|
||||||
|
"state": {
|
||||||
|
"off": "[%key:common::state::off%]",
|
||||||
|
"confirmed": "[%key:component::home_connect::common::confirmed%]",
|
||||||
|
"present": "[%key:component::home_connect::common::present%]"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"refrigerator_door_alarm": {
|
||||||
|
"name": "Refrigerator door alarm",
|
||||||
|
"state": {
|
||||||
|
"off": "[%key:common::state::off%]",
|
||||||
|
"confirmed": "[%key:component::home_connect::common::confirmed%]",
|
||||||
|
"present": "[%key:component::home_connect::common::present%]"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"freezer_temperature_alarm": {
|
||||||
|
"name": "Freezer temperature alarm",
|
||||||
|
"state": {
|
||||||
|
"off": "[%key:common::state::off%]",
|
||||||
|
"confirmed": "[%key:component::home_connect::common::confirmed%]",
|
||||||
|
"present": "[%key:component::home_connect::common::present%]"
|
||||||
|
}
|
||||||
|
},
|
||||||
"empty_dust_box_and_clean_filter": {
|
"empty_dust_box_and_clean_filter": {
|
||||||
"name": "Empty dust box and clean filter",
|
"name": "Empty dust box and clean filter",
|
||||||
"state": {
|
"state": {
|
||||||
@ -1832,22 +1848,6 @@
|
|||||||
"confirmed": "[%key:component::home_connect::common::confirmed%]",
|
"confirmed": "[%key:component::home_connect::common::confirmed%]",
|
||||||
"present": "[%key:component::home_connect::common::present%]"
|
"present": "[%key:component::home_connect::common::present%]"
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"salt_nearly_empty": {
|
|
||||||
"name": "Salt nearly empty",
|
|
||||||
"state": {
|
|
||||||
"off": "[%key:common::state::off%]",
|
|
||||||
"confirmed": "[%key:component::home_connect::common::confirmed%]",
|
|
||||||
"present": "[%key:component::home_connect::common::present%]"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"rinse_aid_nearly_empty": {
|
|
||||||
"name": "Rinse aid nearly empty",
|
|
||||||
"state": {
|
|
||||||
"off": "[%key:common::state::off%]",
|
|
||||||
"confirmed": "[%key:component::home_connect::common::confirmed%]",
|
|
||||||
"present": "[%key:component::home_connect::common::present%]"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"switch": {
|
"switch": {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""Provides time enties for Home Connect."""
|
"""Provides time entities for Home Connect."""
|
||||||
|
|
||||||
from datetime import time
|
from datetime import time
|
||||||
from typing import cast
|
from typing import cast
|
||||||
|
Loading…
x
Reference in New Issue
Block a user