Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugwise fixes from quality review #132158

Merged
merged 2 commits into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions homeassistant/components/plugwise/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ class PlugwiseBinarySensorEntityDescription(BinarySensorEntityDescription):
BINARY_SENSORS: tuple[PlugwiseBinarySensorEntityDescription, ...] = (
PlugwiseBinarySensorEntityDescription(
key="low_battery",
translation_key="low_battery",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please note: this is a breaking change: the name will change from Battery State to Battery.
Also, when implementing this, the corresponding entry in strings.json can be removed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not a breaking change as only the name changes, but not the entity_id. Good point about the strings.json, I missed that

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK Joost, thanks, that's good to know :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Strings adjusted accordingly in 61296d1

device_class=BinarySensorDeviceClass.BATTERY,
entity_category=EntityCategory.DIAGNOSTIC,
),
Expand All @@ -56,7 +55,6 @@ class PlugwiseBinarySensorEntityDescription(BinarySensorEntityDescription):
PlugwiseBinarySensorEntityDescription(
key="flame_state",
translation_key="flame_state",
name="Flame state",
entity_category=EntityCategory.DIAGNOSTIC,
),
PlugwiseBinarySensorEntityDescription(
Expand Down
2 changes: 0 additions & 2 deletions homeassistant/components/plugwise/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ def _add_entities() -> None:
class PlugwiseClimateEntity(PlugwiseEntity, ClimateEntity):
"""Representation of a Plugwise thermostat."""

_attr_has_entity_name = True
_attr_name = None
_attr_temperature_unit = UnitOfTemperature.CELSIUS
_attr_translation_key = DOMAIN
Expand All @@ -75,7 +74,6 @@ def __init__(
) -> None:
"""Set up the Plugwise API."""
super().__init__(coordinator, device_id)
self._attr_extra_state_attributes = {}
self._attr_unique_id = f"{device_id}-climate"

self._devices = coordinator.data.devices
Expand Down
8 changes: 2 additions & 6 deletions homeassistant/components/plugwise/quality_scale.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ rules:
status: todo
comment: Clean up coordinator (L71) check for mypy happiness
entity-unique-id: done
has-entity-name:
status: todo
comment: Clean up climate (already in superclass)
has-entity-name: done
entity-event-setup: done
dependency-transparency: done
action-setup:
Expand Down Expand Up @@ -62,9 +60,7 @@ rules:
status: exempt
comment: Plugwise has no options flow
## Gold
entity-translations:
status: todo
comment: Clean up name where not needed, remove translation key on deviceclasses
entity-translations: done
entity-device-class: done
devices: done
entity-category: done
Expand Down
3 changes: 0 additions & 3 deletions homeassistant/components/plugwise/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@
},
"entity": {
"binary_sensor": {
"low_battery": {
"name": "Battery state"
},
"compressor_state": {
"name": "Compressor state"
},
Expand Down
1 change: 0 additions & 1 deletion homeassistant/components/plugwise/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ class PlugwiseSwitchEntityDescription(SwitchEntityDescription):
PlugwiseSwitchEntityDescription(
key="cooling_ena_switch",
translation_key="cooling_ena_switch",
name="Cooling",
entity_category=EntityCategory.CONFIG,
),
)
Expand Down