mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-11-15 14:00:27 +00:00
Unify Supervisor event message functions (#5831)
* Unify Supervisor event message functions Unify functions which send WebSocket messages of type "supervisor/event". This deduplicates code and hopefully avoids further diversication in the future. While at it, remove unused HomeAssistantWSNotSupported exception. It seems the only place this exception is used got removed in #3317. * Test message delivery during shutdown states
This commit is contained in:
@@ -84,3 +84,11 @@ async def test_send_message_during_startup(coresys: CoreSys, ha_ws_client: Async
|
||||
"data": {"state": "running"},
|
||||
},
|
||||
}
|
||||
|
||||
ha_ws_client.reset_mock()
|
||||
await coresys.core.set_state(CoreState.SHUTDOWN)
|
||||
|
||||
await coresys.homeassistant.websocket.async_supervisor_update_event(
|
||||
"test", {"lorem": "ipsum"}
|
||||
)
|
||||
ha_ws_client.async_send_command.assert_not_called()
|
||||
|
||||
Reference in New Issue
Block a user