remove debug printouts
This commit is contained in:
parent
0243cf2d05
commit
136ca6ac50
@ -9,10 +9,8 @@ from .const import DOMAIN, DATA_DEVICES, DATA_ALIASES, DATA_ADDERS, CONFIG_DEVIC
|
|||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
async def async_setup(hass, config):
|
async def async_setup(hass, config):
|
||||||
_LOGGER.error(f"Setting up browser_mod")
|
|
||||||
|
|
||||||
setup_view(hass)
|
setup_view(hass)
|
||||||
_LOGGER.error(f"Registered frontend script")
|
|
||||||
|
|
||||||
aliases = {}
|
aliases = {}
|
||||||
for d in config[DOMAIN].get(CONFIG_DEVICES, {}):
|
for d in config[DOMAIN].get(CONFIG_DEVICES, {}):
|
||||||
@ -28,9 +26,6 @@ async def async_setup(hass, config):
|
|||||||
|
|
||||||
await hass.helpers.discovery.async_load_platform("media_player", DOMAIN, {}, config)
|
await hass.helpers.discovery.async_load_platform("media_player", DOMAIN, {}, config)
|
||||||
|
|
||||||
_LOGGER.error(f"Set up media_player")
|
|
||||||
_LOGGER.error(hass.data[DOMAIN][DATA_ADDERS])
|
|
||||||
|
|
||||||
setup_connection(hass)
|
setup_connection(hass)
|
||||||
|
|
||||||
setup_service(hass)
|
setup_service(hass)
|
||||||
|
File diff suppressed because one or more lines are too long
@ -12,7 +12,6 @@ _LOGGER = logging.getLogger(__name__)
|
|||||||
def setup_connection(hass):
|
def setup_connection(hass):
|
||||||
async_register_command(hass, handle_connect)
|
async_register_command(hass, handle_connect)
|
||||||
async_register_command(hass, handle_update)
|
async_register_command(hass, handle_update)
|
||||||
_LOGGER.error(f"Registered connect ws command")
|
|
||||||
|
|
||||||
|
|
||||||
@websocket_command({
|
@websocket_command({
|
||||||
@ -20,7 +19,6 @@ def setup_connection(hass):
|
|||||||
vol.Required("deviceID"): str,
|
vol.Required("deviceID"): str,
|
||||||
})
|
})
|
||||||
def handle_connect(hass, connection, msg):
|
def handle_connect(hass, connection, msg):
|
||||||
_LOGGER.error(f"Got connection {msg}")
|
|
||||||
|
|
||||||
devices = hass.data[DOMAIN][DATA_DEVICES]
|
devices = hass.data[DOMAIN][DATA_DEVICES]
|
||||||
deviceID = msg["deviceID"]
|
deviceID = msg["deviceID"]
|
||||||
@ -62,7 +60,6 @@ class BrowserModEntity(Entity):
|
|||||||
def ws_connect(self, connection, cid):
|
def ws_connect(self, connection, cid):
|
||||||
self._ws_cid = cid
|
self._ws_cid = cid
|
||||||
self._ws_connection = connection
|
self._ws_connection = connection
|
||||||
_LOGGER.error(f"Connecting {self.entity_id}")
|
|
||||||
self.ws_send("update", entity_id=self.entity_id)
|
self.ws_send("update", entity_id=self.entity_id)
|
||||||
connection.subscriptions[cid] = self.ws_disconnect
|
connection.subscriptions[cid] = self.ws_disconnect
|
||||||
if self.hass:
|
if self.hass:
|
||||||
|
@ -38,13 +38,11 @@ class BrowserModPlayer(MediaPlayerDevice, BrowserModEntity):
|
|||||||
|
|
||||||
def __init__(self, hass, deviceID, alias=None):
|
def __init__(self, hass, deviceID, alias=None):
|
||||||
super().__init__(hass, deviceID, alias)
|
super().__init__(hass, deviceID, alias)
|
||||||
_LOGGER.error(f"Create player {deviceID}({alias})")
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self):
|
def device_state_attributes(self):
|
||||||
return {
|
return {
|
||||||
"player": self._ws_data.get("player"),
|
**self._ws_data.get("browser", {}),
|
||||||
"browser": self._ws_data.get("browser"),
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
@ -43,19 +43,14 @@ class BrowserMod {
|
|||||||
}
|
}
|
||||||
|
|
||||||
connect(conn) {
|
connect(conn) {
|
||||||
console.log("Connection opened. Connecting to browser_mod");
|
|
||||||
this.conn = conn
|
this.conn = conn
|
||||||
conn.subscribeMessage((msg) => this.callback(msg), {
|
conn.subscribeMessage((msg) => this.callback(msg), {
|
||||||
type: 'browser_mod/connect',
|
type: 'browser_mod/connect',
|
||||||
deviceID: deviceID,
|
deviceID: deviceID,
|
||||||
});
|
});
|
||||||
console.log("Connected");
|
|
||||||
console.log(this.connection);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
callback(msg) {
|
callback(msg) {
|
||||||
console.log("Got ws message");
|
|
||||||
console.log(msg);
|
|
||||||
switch (msg.command) {
|
switch (msg.command) {
|
||||||
case "update":
|
case "update":
|
||||||
this.update(msg);
|
this.update(msg);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user