mirror of
https://github.com/tomaae/homeassistant-mikrotik_router.git
synced 2025-07-08 16:34:28 +02:00
Limit state length to 255 characters, fixes #116
This commit is contained in:
parent
054065922d
commit
57a5ae622b
1 changed files with 5 additions and 1 deletions
|
@ -48,7 +48,11 @@ def from_entry(entry, param, default="") -> str:
|
||||||
if param not in entry:
|
if param not in entry:
|
||||||
return default
|
return default
|
||||||
|
|
||||||
return entry[param]
|
return (
|
||||||
|
entry[param][:255]
|
||||||
|
if isinstance(entry[param], str) and len(entry[param]) > 255
|
||||||
|
else entry[param]
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
# ---------------------------
|
# ---------------------------
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue