* Don't allow duplicate nightscout configs * Fix nightscout translations * Remove unnecessary should_poll method * Remove SVG attribute, as it was duplicating the state * Use aiohttp client session from HA * Move validate_input outside the config class * Use the entry unique_id on the sensor * Move create entity logic * Handle unexpected exception on Nightscout config
7 lines
180 B
Python
7 lines
180 B
Python
"""Nightscout util functions."""
|
|
import hashlib
|
|
|
|
|
|
def hash_from_url(url: str):
|
|
"""Hash url to create a unique ID."""
|
|
return hashlib.sha256(url.encode("utf-8")).hexdigest()
|