Service to send command to browsers
This commit is contained in:
@@ -53,10 +53,11 @@ class BrowserModEntity(Entity):
|
||||
self.entity_id = async_generate_entity_id("media_player.{}", alias or deviceID, hass=hass)
|
||||
|
||||
def ws_send(self, command, **kwargs):
|
||||
self._ws_connection.send_message(event_message(self._ws_cid, {
|
||||
"command": command,
|
||||
**kwargs,
|
||||
}))
|
||||
if self._ws_connection:
|
||||
self._ws_connection.send_message(event_message(self._ws_cid, {
|
||||
"command": command,
|
||||
**kwargs,
|
||||
}))
|
||||
|
||||
def ws_connect(self, connection, cid):
|
||||
self._ws_cid = cid
|
||||
|
||||
Reference in New Issue
Block a user