mirror of
https://github.com/home-assistant/core.git
synced 2025-04-28 11:17:53 +00:00

* 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
8 lines
180 B
Python
8 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()
|