Various fixes
This commit is contained in:
parent
308f6febd2
commit
b7eb237632
@ -46,7 +46,6 @@ def handle_update(hass, connection, msg):
|
||||
|
||||
class BrowserModEntity(Entity):
|
||||
def __init__(self, hass, deviceID, alias=None):
|
||||
self._hass = hass
|
||||
self._deviceID = deviceID
|
||||
self._alias = alias
|
||||
self._ws_data = {}
|
||||
@ -66,16 +65,19 @@ class BrowserModEntity(Entity):
|
||||
_LOGGER.error(f"Connecting {self.entity_id}")
|
||||
self.ws_send("update")
|
||||
connection.subscriptions[cid] = self.ws_disconnect
|
||||
self.schedule_update_ha_state()
|
||||
if self.hass:
|
||||
self.schedule_update_ha_state()
|
||||
|
||||
def ws_disconnect(self):
|
||||
self._ws_cid = None
|
||||
self._ws_connection = None
|
||||
self.schedule_update_ha_state()
|
||||
if self.hass:
|
||||
self.schedule_update_ha_state()
|
||||
|
||||
def ws_update(self, data):
|
||||
self._ws_data = data
|
||||
self.schedule_update_ha_state()
|
||||
if self.hass:
|
||||
self.schedule_update_ha_state()
|
||||
|
||||
@property
|
||||
def device_id(self):
|
||||
|
@ -1,6 +1,7 @@
|
||||
import logging
|
||||
from homeassistant.components.media_player import (
|
||||
SUPPORT_PLAY, SUPPORT_PLAY_MEDIA, SUPPORT_PAUSE, SUPPORT_STOP,
|
||||
SUPPORT_PLAY, SUPPORT_PLAY_MEDIA,
|
||||
SUPPORT_PAUSE, SUPPORT_STOP,
|
||||
SUPPORT_VOLUME_SET, SUPPORT_VOLUME_MUTE,
|
||||
MediaPlayerDevice,
|
||||
)
|
||||
@ -53,7 +54,11 @@ class BrowserModPlayer(MediaPlayerDevice, BrowserModEntity):
|
||||
return None
|
||||
@property
|
||||
def supported_features(self):
|
||||
return 0
|
||||
return (
|
||||
SUPPORT_PLAY | SUPPORT_PLAY_MEDIA |
|
||||
SUPPORT_PAUSE | SUPPORT_STOP |
|
||||
SUPPORT_VOLUME_SET | SUPPORT_VOLUME_MUTE
|
||||
)
|
||||
@property
|
||||
def volume_level(self):
|
||||
return 0
|
||||
|
Loading…
x
Reference in New Issue
Block a user