Improve nuki typing (#86736)

* Use NukiCoordinator

* Make NukiEntity generic

* Remove unnecessary ABC
This commit is contained in:
Marc Mueller 2023-01-26 22:03:36 +01:00 committed by GitHub
parent 138a522d2e
commit caa1ba7e13
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 54 additions and 49 deletions

View file

@ -1,4 +1,7 @@
"""Battery sensor for the Nuki Lock."""
from __future__ import annotations
from pynuki.device import NukiDevice
from homeassistant.components.sensor import SensorDeviceClass, SensorEntity
from homeassistant.config_entries import ConfigEntry
@ -23,7 +26,7 @@ async def async_setup_entry(
)
class NukiBatterySensor(NukiEntity, SensorEntity):
class NukiBatterySensor(NukiEntity[NukiDevice], SensorEntity):
"""Representation of a Nuki Lock Battery sensor."""
_attr_has_entity_name = True