Add tests for Netatmo light (#46381)
* Add tests for Netatmo light * Improve docstring * Register the camera data class for the light platform * Remove freezegun dependency * Update tests * Update tests/components/netatmo/test_light.py Co-authored-by: Erik Montnemery <erik@montnemery.com> * Deduplicate webhook test data * Mock pytest to verify it is called * Don't test internals * Rename * Assert light still on with erroneous event data Co-authored-by: Erik Montnemery <erik@montnemery.com>
This commit is contained in:
parent
7858b59944
commit
aaafe399a1
5 changed files with 95 additions and 1 deletions
|
@ -31,6 +31,10 @@ async def async_setup_entry(hass, entry, async_add_entities):
|
|||
|
||||
data_handler = hass.data[DOMAIN][entry.entry_id][DATA_HANDLER]
|
||||
|
||||
await data_handler.register_data_class(
|
||||
CAMERA_DATA_CLASS_NAME, CAMERA_DATA_CLASS_NAME, None
|
||||
)
|
||||
|
||||
if CAMERA_DATA_CLASS_NAME not in data_handler.data:
|
||||
raise PlatformNotReady
|
||||
|
||||
|
@ -64,6 +68,8 @@ async def async_setup_entry(hass, entry, async_add_entities):
|
|||
|
||||
async_add_entities(await get_entities(), True)
|
||||
|
||||
await data_handler.unregister_data_class(CAMERA_DATA_CLASS_NAME, None)
|
||||
|
||||
|
||||
class NetatmoLight(NetatmoBase, LightEntity):
|
||||
"""Representation of a Netatmo Presence camera light."""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue