remove debug printouts

This commit is contained in:
Thomas Lovén 2019-06-27 15:36:17 +02:00
parent 0243cf2d05
commit 136ca6ac50
5 changed files with 4 additions and 19 deletions

View File

@ -9,10 +9,8 @@ from .const import DOMAIN, DATA_DEVICES, DATA_ALIASES, DATA_ADDERS, CONFIG_DEVIC
_LOGGER = logging.getLogger(__name__)
async def async_setup(hass, config):
_LOGGER.error(f"Setting up browser_mod")
setup_view(hass)
_LOGGER.error(f"Registered frontend script")
aliases = {}
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)
_LOGGER.error(f"Set up media_player")
_LOGGER.error(hass.data[DOMAIN][DATA_ADDERS])
setup_connection(hass)
setup_service(hass)

File diff suppressed because one or more lines are too long

View File

@ -12,7 +12,6 @@ _LOGGER = logging.getLogger(__name__)
def setup_connection(hass):
async_register_command(hass, handle_connect)
async_register_command(hass, handle_update)
_LOGGER.error(f"Registered connect ws command")
@websocket_command({
@ -20,7 +19,6 @@ def setup_connection(hass):
vol.Required("deviceID"): str,
})
def handle_connect(hass, connection, msg):
_LOGGER.error(f"Got connection {msg}")
devices = hass.data[DOMAIN][DATA_DEVICES]
deviceID = msg["deviceID"]
@ -62,7 +60,6 @@ class BrowserModEntity(Entity):
def ws_connect(self, connection, cid):
self._ws_cid = cid
self._ws_connection = connection
_LOGGER.error(f"Connecting {self.entity_id}")
self.ws_send("update", entity_id=self.entity_id)
connection.subscriptions[cid] = self.ws_disconnect
if self.hass:

View File

@ -38,13 +38,11 @@ class BrowserModPlayer(MediaPlayerDevice, BrowserModEntity):
def __init__(self, hass, deviceID, alias=None):
super().__init__(hass, deviceID, alias)
_LOGGER.error(f"Create player {deviceID}({alias})")
@property
def device_state_attributes(self):
return {
"player": self._ws_data.get("player"),
"browser": self._ws_data.get("browser"),
**self._ws_data.get("browser", {}),
}
@property

View File

@ -43,19 +43,14 @@ class BrowserMod {
}
connect(conn) {
console.log("Connection opened. Connecting to browser_mod");
this.conn = conn
conn.subscribeMessage((msg) => this.callback(msg), {
type: 'browser_mod/connect',
deviceID: deviceID,
});
console.log("Connected");
console.log(this.connection);
}
callback(msg) {
console.log("Got ws message");
console.log(msg);
switch (msg.command) {
case "update":
this.update(msg);