Add contextual logging where applicable (#124)
* Add contextual logging where applicable * Compress device id in log output
This commit is contained in:
@@ -38,7 +38,7 @@ class LocaltuyaBinarySensor(LocalTuyaEntity, BinarySensorEntity):
|
||||
**kwargs,
|
||||
):
|
||||
"""Initialize the Tuya binary sensor."""
|
||||
super().__init__(device, config_entry, sensorid, **kwargs)
|
||||
super().__init__(device, config_entry, sensorid, _LOGGER, **kwargs)
|
||||
self._is_on = False
|
||||
|
||||
@property
|
||||
@@ -59,7 +59,7 @@ class LocaltuyaBinarySensor(LocalTuyaEntity, BinarySensorEntity):
|
||||
elif state == self._config[CONF_STATE_OFF].lower():
|
||||
self._is_on = False
|
||||
else:
|
||||
_LOGGER.warning(
|
||||
self.warning(
|
||||
"State for entity %s did not match state patterns", self.entity_id
|
||||
)
|
||||
|
||||
|
Reference in New Issue
Block a user