Force Vera refresh after starting subscription (#46001)

* Force vera refresh after starting subscription.

* Request refresh on device load.

* Update init test.
pull/46062/head
Greg Dowling 2021-02-05 12:20:15 +00:00 committed by GitHub
parent 2a0c36589f
commit e01ca40d56
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 20 additions and 8 deletions

View File

@ -27,7 +27,8 @@ async def async_setup_entry(
[
VeraBinarySensor(device, controller_data)
for device in controller_data.devices.get(PLATFORM_DOMAIN)
]
],
True,
)

View File

@ -44,7 +44,8 @@ async def async_setup_entry(
[
VeraThermostat(device, controller_data)
for device in controller_data.devices.get(PLATFORM_DOMAIN)
]
],
True,
)

View File

@ -28,7 +28,8 @@ async def async_setup_entry(
[
VeraCover(device, controller_data)
for device in controller_data.devices.get(PLATFORM_DOMAIN)
]
],
True,
)

View File

@ -32,7 +32,8 @@ async def async_setup_entry(
[
VeraLight(device, controller_data)
for device in controller_data.devices.get(PLATFORM_DOMAIN)
]
],
True,
)

View File

@ -31,7 +31,8 @@ async def async_setup_entry(
[
VeraLock(device, controller_data)
for device in controller_data.devices.get(PLATFORM_DOMAIN)
]
],
True,
)

View File

@ -21,7 +21,7 @@ async def async_setup_entry(
"""Set up the sensor config entry."""
controller_data = get_controller_data(hass, entry)
async_add_entities(
[VeraScene(device, controller_data) for device in controller_data.scenes]
[VeraScene(device, controller_data) for device in controller_data.scenes], True
)

View File

@ -28,7 +28,8 @@ async def async_setup_entry(
[
VeraSensor(device, controller_data)
for device in controller_data.devices.get(PLATFORM_DOMAIN)
]
],
True,
)

View File

@ -28,7 +28,8 @@ async def async_setup_entry(
[
VeraSwitch(device, controller_data)
for device in controller_data.devices.get(PLATFORM_DOMAIN)
]
],
True,
)

View File

@ -206,6 +206,7 @@ async def test_exclude_and_light_ids(
vera_device3.name = "dev3"
vera_device3.category = pv.CATEGORY_SWITCH
vera_device3.is_switched_on = MagicMock(return_value=False)
entity_id3 = "switch.dev3_3"
vera_device4 = MagicMock(spec=pv.VeraSwitch) # type: pv.VeraSwitch
@ -214,6 +215,10 @@ async def test_exclude_and_light_ids(
vera_device4.name = "dev4"
vera_device4.category = pv.CATEGORY_SWITCH
vera_device4.is_switched_on = MagicMock(return_value=False)
vera_device4.get_brightness = MagicMock(return_value=0)
vera_device4.get_color = MagicMock(return_value=[0, 0, 0])
vera_device4.is_dimmable = True
entity_id4 = "light.dev4_4"
component_data = await vera_component_factory.configure_component(