diff --git a/custom_components/plex_webhooks/__init__.py b/custom_components/plex_webhooks/__init__.py index 7642201..c6ee19b 100644 --- a/custom_components/plex_webhooks/__init__.py +++ b/custom_components/plex_webhooks/__init__.py @@ -29,7 +29,7 @@ async def handle_webhook(hass, webhook_id, request): """Handle webhook callback.""" - logging.debug('Got plex webhook.') + _LOGGER.debug('Got plex webhook.') data = {} @@ -43,7 +43,7 @@ async def handle_webhook(hass, webhook_id, request): if part.name == 'payload': data = await part.json() except ValueError: - logging.warn('Issue decoding webhook: ' + part.text()) + _LOGGER.warn('Issue decoding webhook: ' + part.text()) return None event = data['event'] @@ -56,21 +56,21 @@ async def handle_webhook(hass, webhook_id, request): grabbed = ['library.new'] if event in playing: - logging.debug('Plex started playing') + _LOGGER.debug('Plex started playing') data['status'] = 'PLAYING' data['playerUuid'] = data['Player']['uuid'] elif event in stopped: - logging.debug('Plex stopped playing') + _LOGGER.debug('Plex stopped playing') data['status'] = 'STOPPED' data['playerUuid'] = data['Player']['uuid'] elif event in grabbed: - logging.debug('Plex got new media') + _LOGGER.debug('Plex got new media') data['status'] = 'GRABBED' hass.bus.async_fire(EVENT_RECEIVED, data) async def async_setup(hass, config): - logging.debug('Initing Plex Webhooks!') + _LOGGER.debug('Initing Plex Webhooks!') webhook_id = config[DOMAIN][CONF_WEBHOOK_ID] hass.components.webhook.async_register( DOMAIN, "Plex", webhook_id, handle_webhook diff --git a/custom_components/plex_webhooks/manifest.json b/custom_components/plex_webhooks/manifest.json index b5fe5d6..66abfbb 100644 --- a/custom_components/plex_webhooks/manifest.json +++ b/custom_components/plex_webhooks/manifest.json @@ -2,9 +2,11 @@ "domain": "plex_webhooks", "name": "Plex Webhooks", "documentation": "https://github.com/JBassett/plex_webhooks", - "dependencies": [], + "dependencies": [ + "webhooks" + ], "codeowners": [ "@JBassett" ], "requirements": [] -} \ No newline at end of file +}