2323
2424_LOGGER = logging .getLogger (__name__ )
2525
26+ UPDATE_INTERVAL = timedelta (seconds = 5 )
27+
2628
2729def _my_pv_connection [T ](
2830 func : Callable [..., Coroutine [Any , Any , T ]],
@@ -77,15 +79,12 @@ def __init__(
7779 _LOGGER ,
7880 name = DOMAIN ,
7981 config_entry = config_entry ,
80- update_interval = timedelta ( seconds = 5 ) ,
82+ update_interval = UPDATE_INTERVAL ,
8183 always_update = True ,
8284 )
8385
8486 self .device : Final [MyPVDevice ] = device
8587
86- identifiers = {
87- (DOMAIN , device .serial_number ),
88- }
8988 connections = set ()
9089
9190 if device .mac_address :
@@ -96,7 +95,7 @@ def __init__(
9695 self .device_info : Final [DeviceInfo ] = DeviceInfo (
9796 configuration_url = device .setup_uri ,
9897 connections = connections ,
99- identifiers = identifiers ,
98+ identifiers = {( DOMAIN , device . serial_number )} ,
10099 manufacturer = "my-PV" ,
101100 model = device .model ,
102101 name = name ,
@@ -129,10 +128,7 @@ def command_configurations(self) -> ItemsView[str, Any]:
129128 return self ._command_configurations
130129
131130 async def async_disconnect (self ) -> bool :
132- """Disconnect from my-PV.
133-
134- To be called when coordinator is unloaded, e.g. when device is removed or HA is shut down.
135- """
131+ """Disconnect from my-PV."""
136132 return await self .device .disconnect ()
137133
138134 @override
0 commit comments