@@ -2237,19 +2237,31 @@ async def _async_setup(self) -> None:
22372237 pushed to entities via the inherited ``_on_state_changed`` callback.
22382238 """
22392239 await super ()._async_setup ()
2240- for toggle in SpinoToggle :
2240+ # Start the status report stream so the device pushes dev_statue_t
2241+ # (sys_status / work_mode / battery) — the pool cleaner doesn't report
2242+ # unsolicited otherwise. See get_report_cfg_spino / async_subscribe_status.
2243+
2244+ try :
22412245 with contextlib .suppress (
2242- DeviceOfflineException ,
22432246 GatewayTimeoutException ,
22442247 NoTransportAvailableError ,
2248+ HomeAssistantError ,
22452249 ):
2246- await self .async_send_and_wait (
2247- "read_write_device" ,
2248- "bidire_comm_cmd" ,
2249- rw_id = int (toggle ),
2250- context = 0 ,
2251- rw = 0 ,
2252- )
2250+ await self .async_subscribe_status ()
2251+ for toggle in SpinoToggle :
2252+ with contextlib .suppress (
2253+ GatewayTimeoutException ,
2254+ NoTransportAvailableError ,
2255+ ):
2256+ await self .async_send_and_wait (
2257+ "read_write_device" ,
2258+ "bidire_comm_cmd" ,
2259+ rw_id = int (toggle ),
2260+ context = 0 ,
2261+ rw = 0 ,
2262+ )
2263+ except DeviceOfflineException :
2264+ self .device .online = False
22532265
22542266 async def get_coordinator_data (
22552267 self , device : PoolCleanerDevice
@@ -2327,6 +2339,18 @@ async def update_firmware(self, version: str) -> None:
23272339
23282340 # === Pool cleaner control helpers (called by control entities) ===
23292341
2342+ async def async_subscribe_status (self ) -> None :
2343+ """Start the Spino status report stream (called once at setup).
2344+
2345+ Subscribes to RIT_CONNECT + RIT_DEV_STA with count=0 (continuous) so the
2346+ device pushes dev_statue_t frames; PoolStateReducer applies them.
2347+ """
2348+ await self .async_send_command ("get_report_cfg_spino" , count = 0 )
2349+
2350+ async def async_request_status (self ) -> None :
2351+ """One-shot Spino status poll, backing the refresh-status button."""
2352+ await self .async_send_command ("get_report_cfg_spino" , count = 1 )
2353+
23302354 async def async_set_work_mode (self , work_mode : int ) -> None :
23312355 """Set the Spino cleaning work mode."""
23322356 await self .async_send_command ("set_swimming_work_mode" , work_mode = work_mode )
0 commit comments