Nightscout PR fixes (#38737)
* 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
This commit is contained in:
1 parent
86aa758ecd
commit
52a9921ed3
21 files changed
+74
-215
No files matched your search
@@ -5,7 +5,6 @@ from homeassistant.components.nightscout.const import (
|
||||
ATTR_DELTA,
|
||||
ATTR_DEVICE,
|
||||
ATTR_DIRECTION,
|
||||
ATTR_SVG,
|
||||
)
|
||||
from homeassistant.const import ATTR_ICON, STATE_UNAVAILABLE
|
||||
|
||||
@@ -56,5 +55,4 @@ async def test_sensor_attributes(hass):
|
||||
assert attr[ATTR_DELTA] == reading.delta # pylint: disable=maybe-no-member
|
||||
assert attr[ATTR_DEVICE] == reading.device # pylint: disable=maybe-no-member
|
||||
assert attr[ATTR_DIRECTION] == reading.direction # pylint: disable=maybe-no-member
|
||||
assert attr[ATTR_SVG] == reading.sgv # pylint: disable=maybe-no-member
|
||||
assert attr[ATTR_ICON] == "mdi:arrow-bottom-right"
|
||||
Reference in new issue
Block a user