Skip to content

Commit

Permalink
remove debug printouts
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasloven committed Jun 27, 2019
1 parent 0243cf2 commit 136ca6a
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 19 deletions.
5 changes: 0 additions & 5 deletions custom_components/browser_mod/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@
_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, {}):
Expand All @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions custom_components/browser_mod/browser_mod.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions custom_components/browser_mod/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,13 @@
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({
vol.Required("type"): WS_CONNECT,
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"]
Expand Down Expand Up @@ -62,7 +60,6 @@ def ws_send(self, command, **kwargs):
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:
Expand Down
4 changes: 1 addition & 3 deletions custom_components/browser_mod/media_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 0 additions & 5 deletions js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 136ca6a

Please sign in to comment.