1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 21:06:19 +00:00

Add strict typing to abode (#57673)

This commit is contained in:
Robert Hillis
2022-01-10 09:54:09 -05:00
committed by GitHub
parent bc2f4e82e3
commit 7c51d2f159
25 changed files with 304 additions and 221 deletions

View File

@@ -4,12 +4,13 @@ from unittest.mock import patch
from homeassistant.components.abode.const import DOMAIN as ABODE_DOMAIN
from homeassistant.components.camera import DOMAIN as CAMERA_DOMAIN
from homeassistant.const import ATTR_ENTITY_ID, STATE_IDLE
from homeassistant.core import HomeAssistant
from homeassistant.helpers import entity_registry as er
from .common import setup_platform
async def test_entity_registry(hass):
async def test_entity_registry(hass: HomeAssistant) -> None:
"""Tests that the devices are registered in the entity registry."""
await setup_platform(hass, CAMERA_DOMAIN)
entity_registry = er.async_get(hass)
@@ -18,7 +19,7 @@ async def test_entity_registry(hass):
assert entry.unique_id == "d0a3a1c316891ceb00c20118aae2a133"
async def test_attributes(hass):
async def test_attributes(hass: HomeAssistant) -> None:
"""Test the camera attributes are correct."""
await setup_platform(hass, CAMERA_DOMAIN)
@@ -26,7 +27,7 @@ async def test_attributes(hass):
assert state.state == STATE_IDLE
async def test_capture_image(hass):
async def test_capture_image(hass: HomeAssistant) -> None:
"""Test the camera capture image service."""
await setup_platform(hass, CAMERA_DOMAIN)
@@ -41,7 +42,7 @@ async def test_capture_image(hass):
mock_capture.assert_called_once()
async def test_camera_on(hass):
async def test_camera_on(hass: HomeAssistant) -> None:
"""Test the camera turn on service."""
await setup_platform(hass, CAMERA_DOMAIN)
@@ -56,7 +57,7 @@ async def test_camera_on(hass):
mock_capture.assert_called_once_with(False)
async def test_camera_off(hass):
async def test_camera_off(hass: HomeAssistant) -> None:
"""Test the camera turn off service."""
await setup_platform(hass, CAMERA_DOMAIN)