Change how ring polls for changes to allow more platforms to be added (#25534)
* Add in a switch to control lights and sirens * Improve the way sensors are updated * fixes following flake8 * remove light platform, and fix breaking test. * Resolve issues with tests * add tests for the switch platform * fix up flake8 errors * fix the long strings * fix naming on private method. * updates following p/r * further fixes following pr * removed import * add additional tests to improve code coverage * forgot to check this in
This commit is contained in:
1 parent
92991b53c4
commit
5e7465a261
9 files changed
+118
-38
No files matched your search
@@ -5,7 +5,7 @@ import requests_mock
|
||||
|
||||
import homeassistant.components.ring.sensor as ring
|
||||
from homeassistant.components import ring as base_ring
|
||||
|
||||
from homeassistant.helpers.icon import icon_for_battery_level
|
||||
from tests.components.ring.test_init import ATTRIBUTION, VALID_CONFIG
|
||||
from tests.common import (
|
||||
get_test_config_dir, get_test_home_assistant, load_fixture)
|
||||
@@ -72,6 +72,9 @@ class TestRingSensorSetup(unittest.TestCase):
|
||||
for device in self.DEVICES:
|
||||
device.update()
|
||||
if device.name == 'Front Battery':
|
||||
expected_icon = icon_for_battery_level(
|
||||
battery_level=int(device.state), charging=False)
|
||||
assert device.icon == expected_icon
|
||||
assert 80 == device.state
|
||||
assert 'hp_cam_v1' == \
|
||||
device.device_state_attributes['kind']
|
||||
@@ -109,3 +112,4 @@ class TestRingSensorSetup(unittest.TestCase):
|
||||
assert device.entity_picture is None
|
||||
assert ATTRIBUTION == \
|
||||
device.device_state_attributes['attribution']
|
||||
assert not device.should_poll
|
||||
Reference in new issue
Block a user