10
10
from eheimdigital .types import EheimDeviceType
11
11
12
12
from homeassistant .config_entries import ConfigEntry
13
- from homeassistant .const import CONF_HOST , Platform
13
+ from homeassistant .const import CONF_HOST
14
14
from homeassistant .core import HomeAssistant
15
15
from homeassistant .helpers .aiohttp_client import async_get_clientsession
16
16
from homeassistant .helpers .entity_component import DEFAULT_SCAN_INTERVAL
@@ -26,7 +26,7 @@ class EheimDigitalUpdateCoordinator(
26
26
):
27
27
"""The EHEIM Digital data update coordinator."""
28
28
29
- platform_callbacks : dict [ Platform , AsyncSetupDeviceEntitiesCallback ]
29
+ platform_callbacks : set [ AsyncSetupDeviceEntitiesCallback ]
30
30
config_entry : ConfigEntry
31
31
hub : EheimDigitalHub
32
32
known_devices : set [str ]
@@ -44,16 +44,14 @@ def __init__(self, hass: HomeAssistant) -> None:
44
44
device_found_callback = self ._async_device_found ,
45
45
)
46
46
self .known_devices = set ()
47
- self .platform_callbacks = {}
47
+ self .platform_callbacks = set ()
48
48
49
49
def add_platform_callback (
50
50
self ,
51
- platform : Platform ,
52
51
async_setup_device_entities : AsyncSetupDeviceEntitiesCallback ,
53
52
) -> None :
54
53
"""Add the setup callbacks from a specific platform."""
55
- if platform not in self .platform_callbacks :
56
- self .platform_callbacks [platform ] = async_setup_device_entities
54
+ self .platform_callbacks .add (async_setup_device_entities )
57
55
58
56
async def _async_device_found (
59
57
self , device_address : str , device_type : EheimDeviceType
@@ -64,7 +62,7 @@ async def _async_device_found(
64
62
"""
65
63
66
64
if device_address not in self .known_devices :
67
- for platform_callback in self .platform_callbacks . values () :
65
+ for platform_callback in self .platform_callbacks :
68
66
await platform_callback (device_address )
69
67
70
68
async def _async_receive_callback (self ) -> None :
0 commit comments