From ebc95aca5196cef7f13e591db604d72a2000e625 Mon Sep 17 00:00:00 2001 From: badele Date: Sun, 8 Nov 2015 11:04:29 +0100 Subject: [PATCH 1/4] Add log info in the rfxtrx component --- homeassistant/components/light/rfxtrx.py | 5 +++++ homeassistant/components/sensor/rfxtrx.py | 4 ++++ homeassistant/components/switch/rfxtrx.py | 5 +++++ 3 files changed, 14 insertions(+) diff --git a/homeassistant/components/light/rfxtrx.py b/homeassistant/components/light/rfxtrx.py index 5d6f41fe509..9cbce4f860f 100644 --- a/homeassistant/components/light/rfxtrx.py +++ b/homeassistant/components/light/rfxtrx.py @@ -59,6 +59,11 @@ def setup_platform(hass, config, add_devices_callback, discovery_info=None): # Check if entity exists or previously added automatically if entity_id in rfxtrx.RFX_DEVICES: + _LOGGER.info( + "EntityID: %s light_update. Command: %s", + entity_id, + event.values['Command'] + ) if event.values['Command'] == 'On'\ or event.values['Command'] == 'Off': if event.values['Command'] == 'On': diff --git a/homeassistant/components/sensor/rfxtrx.py b/homeassistant/components/sensor/rfxtrx.py index 220d4ddbca7..79e07fa1517 100644 --- a/homeassistant/components/sensor/rfxtrx.py +++ b/homeassistant/components/sensor/rfxtrx.py @@ -43,6 +43,10 @@ def setup_platform(hass, config, add_devices_callback, discovery_info=None): rfxtrx.RFX_DEVICES[entity_id] = new_sensor add_devices_callback([new_sensor]) else: + _LOGGER.info( + "EntityID: %s sensor_update", + entity_id, + ) rfxtrx.RFX_DEVICES[entity_id].event = event if sensor_update not in rfxtrx.RECEIVED_EVT_SUBSCRIBERS: diff --git a/homeassistant/components/switch/rfxtrx.py b/homeassistant/components/switch/rfxtrx.py index 49a788d0d04..982d42b7901 100644 --- a/homeassistant/components/switch/rfxtrx.py +++ b/homeassistant/components/switch/rfxtrx.py @@ -61,6 +61,11 @@ def setup_platform(hass, config, add_devices_callback, discovery_info=None): # Check if entity exists or previously added automatically if entity_id in rfxtrx.RFX_DEVICES: + _LOGGER.info( + "EntityID: %s switch_update. Command: %s", + entity_id, + event.values['Command'] + ) if event.values['Command'] == 'On'\ or event.values['Command'] == 'Off': if event.values['Command'] == 'On': From fd50693ca7d656bd6b9eaa37dbb851ac5a8ea9fc Mon Sep 17 00:00:00 2001 From: badele Date: Sun, 8 Nov 2015 11:26:36 +0100 Subject: [PATCH 2/4] Minor change to documentation for logger component --- homeassistant/components/logger.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/logger.py b/homeassistant/components/logger.py index 019102fa6f4..2b3f4174bb1 100644 --- a/homeassistant/components/logger.py +++ b/homeassistant/components/logger.py @@ -8,13 +8,21 @@ https://home-assistant.io/components/logger.html Sample configuration +# By default log all messages and ignore log event lowest than critical for custom omponents logger: - default: critical + default: info logs: - homeassistant.components: debug homeassistant.components.device_tracker: critical homeassistant.components.camera: critical +# By default ignore all messages lowest than critical and log event for custom components +logger: + default: critical + logs: + homeassistant.components: info + homeassistant.components.rfxtrx: debug + homeassistant.components.device_tracker: critical + homeassistant.components.camera: critical """ import logging from collections import OrderedDict From ebaecdb9d6fdea313304af0ca07740c7fa35608f Mon Sep 17 00:00:00 2001 From: badele Date: Sun, 8 Nov 2015 11:29:56 +0100 Subject: [PATCH 3/4] Fix flake & pylint --- homeassistant/components/logger.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/logger.py b/homeassistant/components/logger.py index 2b3f4174bb1..ea12cc0c58b 100644 --- a/homeassistant/components/logger.py +++ b/homeassistant/components/logger.py @@ -8,14 +8,16 @@ https://home-assistant.io/components/logger.html Sample configuration -# By default log all messages and ignore log event lowest than critical for custom omponents +# By default log all messages and ignore log event lowest than critical +# for custom omponents logger: default: info logs: homeassistant.components.device_tracker: critical homeassistant.components.camera: critical -# By default ignore all messages lowest than critical and log event for custom components +# By default ignore all messages lowest than critical and log event +# for custom components logger: default: critical logs: From e63d0c51e074c33af6d5473ae542bb013011effa Mon Sep 17 00:00:00 2001 From: badele Date: Sun, 8 Nov 2015 19:02:51 +0100 Subject: [PATCH 4/4] Change log severity --- homeassistant/components/light/rfxtrx.py | 2 +- homeassistant/components/sensor/rfxtrx.py | 2 +- homeassistant/components/switch/rfxtrx.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/light/rfxtrx.py b/homeassistant/components/light/rfxtrx.py index 9cbce4f860f..d9b32bd2faf 100644 --- a/homeassistant/components/light/rfxtrx.py +++ b/homeassistant/components/light/rfxtrx.py @@ -59,7 +59,7 @@ def setup_platform(hass, config, add_devices_callback, discovery_info=None): # Check if entity exists or previously added automatically if entity_id in rfxtrx.RFX_DEVICES: - _LOGGER.info( + _LOGGER.debug( "EntityID: %s light_update. Command: %s", entity_id, event.values['Command'] diff --git a/homeassistant/components/sensor/rfxtrx.py b/homeassistant/components/sensor/rfxtrx.py index 79e07fa1517..b33206faa29 100644 --- a/homeassistant/components/sensor/rfxtrx.py +++ b/homeassistant/components/sensor/rfxtrx.py @@ -43,7 +43,7 @@ def setup_platform(hass, config, add_devices_callback, discovery_info=None): rfxtrx.RFX_DEVICES[entity_id] = new_sensor add_devices_callback([new_sensor]) else: - _LOGGER.info( + _LOGGER.debug( "EntityID: %s sensor_update", entity_id, ) diff --git a/homeassistant/components/switch/rfxtrx.py b/homeassistant/components/switch/rfxtrx.py index 982d42b7901..5654725e6b0 100644 --- a/homeassistant/components/switch/rfxtrx.py +++ b/homeassistant/components/switch/rfxtrx.py @@ -61,7 +61,7 @@ def setup_platform(hass, config, add_devices_callback, discovery_info=None): # Check if entity exists or previously added automatically if entity_id in rfxtrx.RFX_DEVICES: - _LOGGER.info( + _LOGGER.debug( "EntityID: %s switch_update. Command: %s", entity_id, event.values['Command']