mirror of
https://github.com/tomaae/homeassistant-mikrotik_router.git
synced 2025-06-29 20:14:30 +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:
|
||||
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