Logger integration & more log messages
This commit is contained in:
parent
4722abce31
commit
0391f03244
|
@ -94,8 +94,8 @@ dimmer:
|
|||
cover_half:
|
||||
|
||||
|
||||
#logger:
|
||||
# default: info
|
||||
logger:
|
||||
default: info
|
||||
# logs:
|
||||
# xknx.telegram: debug
|
||||
# xknx.knx: debug
|
||||
|
|
|
@ -66,6 +66,7 @@ class FhemSwitch(SwitchDevice):
|
|||
|
||||
async def line_received(self, line):
|
||||
line = line.strip()
|
||||
_LOGGER.debug(f"Switch received line {line}")
|
||||
if not self._available:
|
||||
_LOGGER.warning(f"Line for unavailable device {self.name}: {line}")
|
||||
if line.startswith('level:'):
|
||||
|
|
|
@ -64,10 +64,14 @@ class ReconnectingClient:
|
|||
await self._receive_line_callback(line)
|
||||
except OSError as e:
|
||||
if self._connection_last_state != 'FAILED':
|
||||
notification_text = "{} connection to {}:{} failed".format(self._connection_name,self._host, self._port)
|
||||
notification_text = "{} connection to {}:{} failed".format(self._connection_name, self._host,
|
||||
self._port)
|
||||
self.hass.components.persistent_notification.async_create(notification_text, title="No connection")
|
||||
_LOGGER.error("Connection to {} failed {}:{}".format(self._connection_name, self._host, self._port))
|
||||
await self._connection_status_changed_callback('disconnected')
|
||||
else:
|
||||
_LOGGER.debug(f"{self._connection_name} retried connection, last state {self._connection_last_state}"
|
||||
f"reconnection time {self.reconnect_time}")
|
||||
self._connection_last_state = 'FAILED'
|
||||
self.connected = False
|
||||
await asyncio.sleep(self.reconnect_time)
|
||||
|
|
Loading…
Reference in New Issue