Raised log level to warning for failed keep-alive check
This commit is contained in:
parent
bbd73897a0
commit
7453534927
@ -14,7 +14,7 @@ from dsmr_parser.clients.settings import SERIAL_SETTINGS_V2_2, \
|
|||||||
SERIAL_SETTINGS_V4, SERIAL_SETTINGS_V5
|
SERIAL_SETTINGS_V4, SERIAL_SETTINGS_V5
|
||||||
|
|
||||||
|
|
||||||
def create_dsmr_protocol(dsmr_version, telegram_callback, loop=None, **args):
|
def create_dsmr_protocol(dsmr_version, telegram_callback, loop=None, **kwargs):
|
||||||
"""Creates a DSMR asyncio protocol."""
|
"""Creates a DSMR asyncio protocol."""
|
||||||
|
|
||||||
if dsmr_version == '2.2':
|
if dsmr_version == '2.2':
|
||||||
@ -37,7 +37,7 @@ def create_dsmr_protocol(dsmr_version, telegram_callback, loop=None, **args):
|
|||||||
dsmr_version)
|
dsmr_version)
|
||||||
|
|
||||||
protocol = partial(DSMRProtocol, loop, TelegramParser(specification),
|
protocol = partial(DSMRProtocol, loop, TelegramParser(specification),
|
||||||
telegram_callback=telegram_callback, **args)
|
telegram_callback=telegram_callback, **kwargs)
|
||||||
|
|
||||||
return protocol, serial_settings
|
return protocol, serial_settings
|
||||||
|
|
||||||
@ -110,7 +110,7 @@ class DSMRProtocol(asyncio.Protocol):
|
|||||||
self._active = False
|
self._active = False
|
||||||
self.loop.call_later(self._keep_alive_interval, self.keep_alive)
|
self.loop.call_later(self._keep_alive_interval, self.keep_alive)
|
||||||
else:
|
else:
|
||||||
self.log.debug('keep-alive failed')
|
self.log.warning('keep-alive check failed')
|
||||||
self.transport.close()
|
self.transport.close()
|
||||||
|
|
||||||
def connection_lost(self, exc):
|
def connection_lost(self, exc):
|
||||||
|
Loading…
Reference in New Issue
Block a user