Plugwise fixes from quality review (#132158)

This commit is contained in:
Tom 2024-12-03 12:34:03 +01:00 committed by GitHub
parent 003d4d712a
commit aeab8a0143
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 2 additions and 14 deletions

View File

@ -34,7 +34,6 @@ class PlugwiseBinarySensorEntityDescription(BinarySensorEntityDescription):
BINARY_SENSORS: tuple[PlugwiseBinarySensorEntityDescription, ...] = ( BINARY_SENSORS: tuple[PlugwiseBinarySensorEntityDescription, ...] = (
PlugwiseBinarySensorEntityDescription( PlugwiseBinarySensorEntityDescription(
key="low_battery", key="low_battery",
translation_key="low_battery",
device_class=BinarySensorDeviceClass.BATTERY, device_class=BinarySensorDeviceClass.BATTERY,
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
), ),
@ -56,7 +55,6 @@ BINARY_SENSORS: tuple[PlugwiseBinarySensorEntityDescription, ...] = (
PlugwiseBinarySensorEntityDescription( PlugwiseBinarySensorEntityDescription(
key="flame_state", key="flame_state",
translation_key="flame_state", translation_key="flame_state",
name="Flame state",
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
), ),
PlugwiseBinarySensorEntityDescription( PlugwiseBinarySensorEntityDescription(

View File

@ -60,7 +60,6 @@ async def async_setup_entry(
class PlugwiseClimateEntity(PlugwiseEntity, ClimateEntity): class PlugwiseClimateEntity(PlugwiseEntity, ClimateEntity):
"""Representation of a Plugwise thermostat.""" """Representation of a Plugwise thermostat."""
_attr_has_entity_name = True
_attr_name = None _attr_name = None
_attr_temperature_unit = UnitOfTemperature.CELSIUS _attr_temperature_unit = UnitOfTemperature.CELSIUS
_attr_translation_key = DOMAIN _attr_translation_key = DOMAIN
@ -75,7 +74,6 @@ class PlugwiseClimateEntity(PlugwiseEntity, ClimateEntity):
) -> None: ) -> None:
"""Set up the Plugwise API.""" """Set up the Plugwise API."""
super().__init__(coordinator, device_id) super().__init__(coordinator, device_id)
self._attr_extra_state_attributes = {}
self._attr_unique_id = f"{device_id}-climate" self._attr_unique_id = f"{device_id}-climate"
self._devices = coordinator.data.devices self._devices = coordinator.data.devices

View File

@ -16,9 +16,7 @@ rules:
status: todo status: todo
comment: Clean up coordinator (L71) check for mypy happiness comment: Clean up coordinator (L71) check for mypy happiness
entity-unique-id: done entity-unique-id: done
has-entity-name: has-entity-name: done
status: todo
comment: Clean up climate (already in superclass)
entity-event-setup: done entity-event-setup: done
dependency-transparency: done dependency-transparency: done
action-setup: action-setup:
@ -62,9 +60,7 @@ rules:
status: exempt status: exempt
comment: Plugwise has no options flow comment: Plugwise has no options flow
## Gold ## Gold
entity-translations: entity-translations: done
status: todo
comment: Clean up name where not needed, remove translation key on deviceclasses
entity-device-class: done entity-device-class: done
devices: done devices: done
entity-category: done entity-category: done

View File

@ -30,9 +30,6 @@
}, },
"entity": { "entity": {
"binary_sensor": { "binary_sensor": {
"low_battery": {
"name": "Battery state"
},
"compressor_state": { "compressor_state": {
"name": "Compressor state" "name": "Compressor state"
}, },

View File

@ -48,7 +48,6 @@ SWITCHES: tuple[PlugwiseSwitchEntityDescription, ...] = (
PlugwiseSwitchEntityDescription( PlugwiseSwitchEntityDescription(
key="cooling_ena_switch", key="cooling_ena_switch",
translation_key="cooling_ena_switch", translation_key="cooling_ena_switch",
name="Cooling",
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
), ),
) )