Improve type hints in homekit and homekit_controller tests (#124213)
Add missing hass type hint in homekit and homekit_controller tests
This commit is contained in:
parent
be255613de
commit
db92f29c00
24 changed files with 132 additions and 85 deletions
|
@ -2,6 +2,7 @@
|
|||
|
||||
from collections.abc import Callable
|
||||
|
||||
from aiohomekit.model import Accessory
|
||||
from aiohomekit.model.characteristics import CharacteristicsTypes
|
||||
from aiohomekit.model.services import ServicesTypes
|
||||
|
||||
|
@ -12,7 +13,7 @@ from homeassistant.helpers import entity_registry as er
|
|||
from .common import setup_test_component
|
||||
|
||||
|
||||
def create_remote(accessory):
|
||||
def create_remote(accessory: Accessory) -> None:
|
||||
"""Define characteristics for a button (that is inn a group)."""
|
||||
service_label = accessory.add_service(ServicesTypes.SERVICE_LABEL)
|
||||
|
||||
|
@ -37,7 +38,7 @@ def create_remote(accessory):
|
|||
battery.add_char(CharacteristicsTypes.BATTERY_LEVEL)
|
||||
|
||||
|
||||
def create_button(accessory):
|
||||
def create_button(accessory: Accessory) -> None:
|
||||
"""Define a button (that is not in a group)."""
|
||||
button = accessory.add_service(ServicesTypes.STATELESS_PROGRAMMABLE_SWITCH)
|
||||
|
||||
|
@ -52,7 +53,7 @@ def create_button(accessory):
|
|||
battery.add_char(CharacteristicsTypes.BATTERY_LEVEL)
|
||||
|
||||
|
||||
def create_doorbell(accessory):
|
||||
def create_doorbell(accessory: Accessory) -> None:
|
||||
"""Define a button (that is not in a group)."""
|
||||
button = accessory.add_service(ServicesTypes.DOORBELL)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue