mirror of
https://github.com/fmtr/haco.git
synced 2026-10-25 18:40:15 -04:00
Refine logging, sanitized name separators
This commit is contained in:
parent
747fca5ab1
commit
33ea83362d
3 changed files with 3 additions and 3 deletions
|
|
@ -3,7 +3,7 @@ import string
|
|||
from pathlib import Path
|
||||
|
||||
CHARS_ALLOWED = string.ascii_lowercase + string.digits
|
||||
SEPS_ALLOWED = '_- '
|
||||
SEPS = '_- /'
|
||||
BRANCH = 'release'
|
||||
|
||||
CONFIGS_PATH = Path(os.environ['HACO_CONFIGS_PATH'])
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ async def listen(client, devices):
|
|||
break
|
||||
|
||||
if not device:
|
||||
msg = f'Got announce from device with no config: Hostname: {data_announce["hostname"]} MAC:{data_announce["mac"]}. Publishing config data.'
|
||||
msg = f"""Found device with no configuration module assigned. Assign one in Add-On Configuration: "{data_announce["device_name"]}" Hostname: {data_announce["hostname"]} {data_announce["hostname"]} MAC:{data_announce["mac"]}."""
|
||||
tools.logger.info(msg)
|
||||
continue
|
||||
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ def sanitize_name(s, sep='-'):
|
|||
chars = []
|
||||
|
||||
for c in s.lower():
|
||||
if c in constants.SEPS_ALLOWED:
|
||||
if c in constants.SEPS:
|
||||
chars.append(sep)
|
||||
elif c in constants.CHARS_ALLOWED:
|
||||
chars.append(c)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue