mirror of
https://github.com/home-assistant/core.git
synced 2025-07-18 18:57:06 +00:00
Remove attributes from Nuki entities (#125348)
* Remove attributes from Nuki entities * remove tests
This commit is contained in:
parent
9777ed2e62
commit
f8c94fd83f
@ -15,7 +15,7 @@ from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
|
||||
from . import NukiEntity, NukiEntryData
|
||||
from .const import ATTR_NUKI_ID, DOMAIN as NUKI_DOMAIN
|
||||
from .const import DOMAIN as NUKI_DOMAIN
|
||||
|
||||
|
||||
async def async_setup_entry(
|
||||
@ -51,14 +51,6 @@ class NukiDoorsensorEntity(NukiEntity[NukiDevice], BinarySensorEntity):
|
||||
"""Return a unique ID."""
|
||||
return f"{self._nuki_device.nuki_id}_doorsensor"
|
||||
|
||||
# Deprecated, can be removed in 2024.10
|
||||
@property
|
||||
def extra_state_attributes(self):
|
||||
"""Return the device specific state attributes."""
|
||||
return {
|
||||
ATTR_NUKI_ID: self._nuki_device.nuki_id,
|
||||
}
|
||||
|
||||
@property
|
||||
def available(self) -> bool:
|
||||
"""Return true if door sensor is present and activated."""
|
||||
@ -91,14 +83,6 @@ class NukiRingactionEntity(NukiEntity[NukiDevice], BinarySensorEntity):
|
||||
"""Return a unique ID."""
|
||||
return f"{self._nuki_device.nuki_id}_ringaction"
|
||||
|
||||
# Deprecated, can be removed in 2024.10
|
||||
@property
|
||||
def extra_state_attributes(self):
|
||||
"""Return the device specific state attributes."""
|
||||
return {
|
||||
ATTR_NUKI_ID: self._nuki_device.nuki_id,
|
||||
}
|
||||
|
||||
@property
|
||||
def is_on(self) -> bool:
|
||||
"""Return the value of the ring action state."""
|
||||
|
@ -18,14 +18,7 @@ from homeassistant.helpers import config_validation as cv, entity_platform
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
|
||||
from . import NukiEntity, NukiEntryData
|
||||
from .const import (
|
||||
ATTR_BATTERY_CRITICAL,
|
||||
ATTR_ENABLE,
|
||||
ATTR_NUKI_ID,
|
||||
ATTR_UNLATCH,
|
||||
DOMAIN as NUKI_DOMAIN,
|
||||
ERROR_STATES,
|
||||
)
|
||||
from .const import ATTR_ENABLE, ATTR_UNLATCH, DOMAIN as NUKI_DOMAIN, ERROR_STATES
|
||||
from .helpers import CannotConnect
|
||||
|
||||
|
||||
@ -75,15 +68,6 @@ class NukiDeviceEntity[_NukiDeviceT: NukiDevice](NukiEntity[_NukiDeviceT], LockE
|
||||
"""Return a unique ID."""
|
||||
return self._nuki_device.nuki_id
|
||||
|
||||
# Deprecated, can be removed in 2024.10
|
||||
@property
|
||||
def extra_state_attributes(self) -> dict[str, Any]:
|
||||
"""Return the device specific state attributes."""
|
||||
return {
|
||||
ATTR_BATTERY_CRITICAL: self._nuki_device.battery_critical,
|
||||
ATTR_NUKI_ID: self._nuki_device.nuki_id,
|
||||
}
|
||||
|
||||
@property
|
||||
def available(self) -> bool:
|
||||
"""Return True if entity is available."""
|
||||
|
@ -11,7 +11,7 @@ from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
|
||||
from . import NukiEntity, NukiEntryData
|
||||
from .const import ATTR_NUKI_ID, DOMAIN as NUKI_DOMAIN
|
||||
from .const import DOMAIN as NUKI_DOMAIN
|
||||
|
||||
|
||||
async def async_setup_entry(
|
||||
@ -38,12 +38,6 @@ class NukiBatterySensor(NukiEntity[NukiDevice], SensorEntity):
|
||||
"""Return a unique ID."""
|
||||
return f"{self._nuki_device.nuki_id}_battery_level"
|
||||
|
||||
# Deprecated, can be removed in 2024.10
|
||||
@property
|
||||
def extra_state_attributes(self):
|
||||
"""Return the device specific state attributes."""
|
||||
return {ATTR_NUKI_ID: self._nuki_device.nuki_id}
|
||||
|
||||
@property
|
||||
def native_value(self) -> float:
|
||||
"""Return the state of the sensor."""
|
||||
|
@ -83,7 +83,6 @@
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'friendly_name': 'Community door Ring Action',
|
||||
'nuki_id': 2,
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'binary_sensor.community_door_ring_action',
|
||||
@ -131,7 +130,6 @@
|
||||
'attributes': ReadOnlyDict({
|
||||
'device_class': 'door',
|
||||
'friendly_name': 'Home',
|
||||
'nuki_id': 1,
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'binary_sensor.home',
|
||||
|
@ -35,9 +35,7 @@
|
||||
# name: test_locks[lock.community_door-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'battery_critical': False,
|
||||
'friendly_name': 'Community door',
|
||||
'nuki_id': 2,
|
||||
'supported_features': <LockEntityFeature: 1>,
|
||||
}),
|
||||
'context': <ANY>,
|
||||
@ -84,9 +82,7 @@
|
||||
# name: test_locks[lock.home-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'battery_critical': False,
|
||||
'friendly_name': 'Home',
|
||||
'nuki_id': 1,
|
||||
'supported_features': <LockEntityFeature: 1>,
|
||||
}),
|
||||
'context': <ANY>,
|
||||
|
@ -37,7 +37,6 @@
|
||||
'attributes': ReadOnlyDict({
|
||||
'device_class': 'battery',
|
||||
'friendly_name': 'Home Battery',
|
||||
'nuki_id': 1,
|
||||
'unit_of_measurement': '%',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
|
Loading…
x
Reference in New Issue
Block a user