diff --git a/homeassistant/components/nuki/binary_sensor.py b/homeassistant/components/nuki/binary_sensor.py index 02135ed3ead..c01c1c50237 100644 --- a/homeassistant/components/nuki/binary_sensor.py +++ b/homeassistant/components/nuki/binary_sensor.py @@ -29,6 +29,7 @@ async def async_setup_entry( if lock.is_door_sensor_activated: entities.append(NukiDoorsensorEntity(entry_data.coordinator, lock)) entities.append(NukiBatteryCriticalEntity(entry_data.coordinator, lock)) + entities.append(NukiBatteryChargingEntity(entry_data.coordinator, lock)) for opener in entry_data.openers: entities.append(NukiRingactionEntity(entry_data.coordinator, opener)) @@ -107,7 +108,6 @@ class NukiBatteryCriticalEntity(NukiEntity[NukiDevice], BinarySensorEntity): """Representation of Nuki Battery Critical.""" _attr_has_entity_name = True - _attr_translation_key = "battery_critical" _attr_device_class = BinarySensorDeviceClass.BATTERY _attr_entity_category = EntityCategory.DIAGNOSTIC @@ -118,5 +118,24 @@ class NukiBatteryCriticalEntity(NukiEntity[NukiDevice], BinarySensorEntity): @property def is_on(self) -> bool: - """Return the value of the ring action state.""" + """Return the value of the battery critical.""" return self._nuki_device.battery_critical + + +class NukiBatteryChargingEntity(NukiEntity[NukiDevice], BinarySensorEntity): + """Representation of a Nuki Battery charging.""" + + _attr_has_entity_name = True + _attr_device_class = BinarySensorDeviceClass.BATTERY_CHARGING + _attr_entity_category = EntityCategory.DIAGNOSTIC + _attr_entity_registry_enabled_default = False + + @property + def unique_id(self) -> str: + """Return a unique ID.""" + return f"{self._nuki_device.nuki_id}_battery_charging" + + @property + def is_on(self) -> bool: + """Return the value of the battery charging.""" + return self._nuki_device.battery_charging diff --git a/homeassistant/components/nuki/manifest.json b/homeassistant/components/nuki/manifest.json index b84bee660c1..b2e039ec122 100644 --- a/homeassistant/components/nuki/manifest.json +++ b/homeassistant/components/nuki/manifest.json @@ -12,5 +12,5 @@ "documentation": "https://www.home-assistant.io/integrations/nuki", "iot_class": "local_polling", "loggers": ["pynuki"], - "requirements": ["pynuki==1.6.2"] + "requirements": ["pynuki==1.6.3"] } diff --git a/homeassistant/components/nuki/strings.json b/homeassistant/components/nuki/strings.json index e05fce36e29..beac3cb7f74 100644 --- a/homeassistant/components/nuki/strings.json +++ b/homeassistant/components/nuki/strings.json @@ -41,9 +41,6 @@ "binary_sensor": { "ring_action": { "name": "Ring Action" - }, - "battery_critical": { - "name": "Battery critical" } }, "lock": { diff --git a/requirements_all.txt b/requirements_all.txt index fd8e6303e01..d1ef1cccd60 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -1992,7 +1992,7 @@ pynetio==0.1.9.1 pynobo==1.6.0 # homeassistant.components.nuki -pynuki==1.6.2 +pynuki==1.6.3 # homeassistant.components.nut pynut2==2.1.2 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 654baf3018b..7240ec305c3 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -1537,7 +1537,7 @@ pynetgear==0.10.10 pynobo==1.6.0 # homeassistant.components.nuki -pynuki==1.6.2 +pynuki==1.6.3 # homeassistant.components.nut pynut2==2.1.2