Migrate Plugwise to new entity naming style (#75109)
parent
05d2b955ee
commit
93425b0e4d
|
@ -31,14 +31,14 @@ class PlugwiseBinarySensorEntityDescription(BinarySensorEntityDescription):
|
|||
BINARY_SENSORS: tuple[PlugwiseBinarySensorEntityDescription, ...] = (
|
||||
PlugwiseBinarySensorEntityDescription(
|
||||
key="dhw_state",
|
||||
name="DHW State",
|
||||
name="DHW state",
|
||||
icon="mdi:water-pump",
|
||||
icon_off="mdi:water-pump-off",
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
),
|
||||
PlugwiseBinarySensorEntityDescription(
|
||||
key="flame_state",
|
||||
name="Flame State",
|
||||
name="Flame state",
|
||||
icon="mdi:fire",
|
||||
icon_off="mdi:fire-off",
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
|
@ -59,14 +59,14 @@ BINARY_SENSORS: tuple[PlugwiseBinarySensorEntityDescription, ...] = (
|
|||
),
|
||||
PlugwiseBinarySensorEntityDescription(
|
||||
key="slave_boiler_state",
|
||||
name="Secondary Boiler State",
|
||||
name="Secondary boiler state",
|
||||
icon="mdi:fire",
|
||||
icon_off="mdi:circle-off-outline",
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
),
|
||||
PlugwiseBinarySensorEntityDescription(
|
||||
key="plugwise_notification",
|
||||
name="Plugwise Notification",
|
||||
name="Plugwise notification",
|
||||
icon="mdi:mailbox-up-outline",
|
||||
icon_off="mdi:mailbox-outline",
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
|
@ -118,7 +118,6 @@ class PlugwiseBinarySensorEntity(PlugwiseEntity, BinarySensorEntity):
|
|||
super().__init__(coordinator, device_id)
|
||||
self.entity_description = description
|
||||
self._attr_unique_id = f"{device_id}-{description.key}"
|
||||
self._attr_name = (f"{self.device.get('name', '')} {description.name}").lstrip()
|
||||
|
||||
@property
|
||||
def is_on(self) -> bool | None:
|
||||
|
|
|
@ -39,6 +39,7 @@ class PlugwiseClimateEntity(PlugwiseEntity, ClimateEntity):
|
|||
"""Representation of an Plugwise thermostat."""
|
||||
|
||||
_attr_temperature_unit = TEMP_CELSIUS
|
||||
_attr_has_entity_name = True
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
|
@ -49,7 +50,6 @@ class PlugwiseClimateEntity(PlugwiseEntity, ClimateEntity):
|
|||
super().__init__(coordinator, device_id)
|
||||
self._attr_extra_state_attributes = {}
|
||||
self._attr_unique_id = f"{device_id}-climate"
|
||||
self._attr_name = self.device.get("name")
|
||||
|
||||
# Determine preset modes
|
||||
self._attr_supported_features = ClimateEntityFeature.TARGET_TEMPERATURE
|
||||
|
|
|
@ -18,6 +18,8 @@ from .coordinator import PlugwiseDataUpdateCoordinator
|
|||
class PlugwiseEntity(CoordinatorEntity[PlugwiseDataUpdateCoordinator]):
|
||||
"""Represent a PlugWise Entity."""
|
||||
|
||||
_attr_has_entity_name = True
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
coordinator: PlugwiseDataUpdateCoordinator,
|
||||
|
@ -44,7 +46,7 @@ class PlugwiseEntity(CoordinatorEntity[PlugwiseDataUpdateCoordinator]):
|
|||
connections=connections,
|
||||
manufacturer=data.get("vendor"),
|
||||
model=data.get("model"),
|
||||
name=f"Smile {coordinator.data.gateway['smile_name']}",
|
||||
name=coordinator.data.gateway["smile_name"],
|
||||
sw_version=data.get("firmware"),
|
||||
hw_version=data.get("hardware"),
|
||||
)
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
"domain": "plugwise",
|
||||
"name": "Plugwise",
|
||||
"documentation": "https://www.home-assistant.io/integrations/plugwise",
|
||||
"requirements": ["plugwise==0.18.6"],
|
||||
"requirements": ["plugwise==0.18.7"],
|
||||
"codeowners": ["@CoMPaTech", "@bouwew", "@brefra", "@frenck"],
|
||||
"zeroconf": ["_plugwise._tcp.local."],
|
||||
"config_flow": true,
|
||||
|
|
|
@ -42,7 +42,7 @@ NUMBER_TYPES = (
|
|||
key="maximum_boiler_temperature",
|
||||
command=lambda api, value: api.set_max_boiler_temperature(value),
|
||||
device_class=NumberDeviceClass.TEMPERATURE,
|
||||
name="Maximum Boiler Temperature Setpoint",
|
||||
name="Maximum boiler temperature setpoint",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
native_unit_of_measurement=TEMP_CELSIUS,
|
||||
),
|
||||
|
@ -86,7 +86,6 @@ class PlugwiseNumberEntity(PlugwiseEntity, NumberEntity):
|
|||
super().__init__(coordinator, device_id)
|
||||
self.entity_description = description
|
||||
self._attr_unique_id = f"{device_id}-{description.key}"
|
||||
self._attr_name = (f"{self.device['name']} {description.name}").lstrip()
|
||||
self._attr_mode = NumberMode.BOX
|
||||
|
||||
@property
|
||||
|
|
|
@ -38,7 +38,7 @@ class PlugwiseSelectEntityDescription(
|
|||
SELECT_TYPES = (
|
||||
PlugwiseSelectEntityDescription(
|
||||
key="select_schedule",
|
||||
name="Thermostat Schedule",
|
||||
name="Thermostat schedule",
|
||||
icon="mdi:calendar-clock",
|
||||
command=lambda api, loc, opt: api.set_schedule_state(loc, opt, STATE_ON),
|
||||
current_option="selected_schedule",
|
||||
|
@ -46,7 +46,7 @@ SELECT_TYPES = (
|
|||
),
|
||||
PlugwiseSelectEntityDescription(
|
||||
key="select_regulation_mode",
|
||||
name="Regulation Mode",
|
||||
name="Regulation mode",
|
||||
icon="mdi:hvac",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
command=lambda api, loc, opt: api.set_regulation_mode(opt),
|
||||
|
@ -92,7 +92,6 @@ class PlugwiseSelectEntity(PlugwiseEntity, SelectEntity):
|
|||
super().__init__(coordinator, device_id)
|
||||
self.entity_description = entity_description
|
||||
self._attr_unique_id = f"{device_id}-{entity_description.key}"
|
||||
self._attr_name = (f"{self.device['name']} {entity_description.name}").lstrip()
|
||||
|
||||
@property
|
||||
def current_option(self) -> str:
|
||||
|
|
|
@ -41,182 +41,182 @@ SENSORS: tuple[SensorEntityDescription, ...] = (
|
|||
),
|
||||
SensorEntityDescription(
|
||||
key="intended_boiler_temperature",
|
||||
name="Intended Boiler Temperature",
|
||||
name="Intended boiler temperature",
|
||||
native_unit_of_measurement=TEMP_CELSIUS,
|
||||
device_class=SensorDeviceClass.TEMPERATURE,
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
),
|
||||
SensorEntityDescription(
|
||||
key="temperature_difference",
|
||||
name="Temperature Difference",
|
||||
name="Temperature difference",
|
||||
native_unit_of_measurement=TEMP_CELSIUS,
|
||||
device_class=SensorDeviceClass.TEMPERATURE,
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
),
|
||||
SensorEntityDescription(
|
||||
key="outdoor_temperature",
|
||||
name="Outdoor Temperature",
|
||||
name="Outdoor temperature",
|
||||
native_unit_of_measurement=TEMP_CELSIUS,
|
||||
device_class=SensorDeviceClass.TEMPERATURE,
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
),
|
||||
SensorEntityDescription(
|
||||
key="outdoor_air_temperature",
|
||||
name="Outdoor Air Temperature",
|
||||
name="Outdoor air temperature",
|
||||
native_unit_of_measurement=TEMP_CELSIUS,
|
||||
device_class=SensorDeviceClass.TEMPERATURE,
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
),
|
||||
SensorEntityDescription(
|
||||
key="water_temperature",
|
||||
name="Water Temperature",
|
||||
name="Water temperature",
|
||||
native_unit_of_measurement=TEMP_CELSIUS,
|
||||
device_class=SensorDeviceClass.TEMPERATURE,
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
),
|
||||
SensorEntityDescription(
|
||||
key="return_temperature",
|
||||
name="Return Temperature",
|
||||
name="Return temperature",
|
||||
native_unit_of_measurement=TEMP_CELSIUS,
|
||||
device_class=SensorDeviceClass.TEMPERATURE,
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
),
|
||||
SensorEntityDescription(
|
||||
key="electricity_consumed",
|
||||
name="Electricity Consumed",
|
||||
name="Electricity consumed",
|
||||
native_unit_of_measurement=POWER_WATT,
|
||||
device_class=SensorDeviceClass.POWER,
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
),
|
||||
SensorEntityDescription(
|
||||
key="electricity_produced",
|
||||
name="Electricity Produced",
|
||||
name="Electricity produced",
|
||||
native_unit_of_measurement=POWER_WATT,
|
||||
device_class=SensorDeviceClass.POWER,
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
),
|
||||
SensorEntityDescription(
|
||||
key="electricity_consumed_interval",
|
||||
name="Electricity Consumed Interval",
|
||||
name="Electricity consumed interval",
|
||||
native_unit_of_measurement=ENERGY_WATT_HOUR,
|
||||
device_class=SensorDeviceClass.ENERGY,
|
||||
state_class=SensorStateClass.TOTAL,
|
||||
),
|
||||
SensorEntityDescription(
|
||||
key="electricity_consumed_peak_interval",
|
||||
name="Electricity Consumed Peak Interval",
|
||||
name="Electricity consumed peak interval",
|
||||
native_unit_of_measurement=ENERGY_WATT_HOUR,
|
||||
device_class=SensorDeviceClass.ENERGY,
|
||||
state_class=SensorStateClass.TOTAL,
|
||||
),
|
||||
SensorEntityDescription(
|
||||
key="electricity_consumed_off_peak_interval",
|
||||
name="Electricity Consumed Off Peak Interval",
|
||||
name="Electricity consumed off peak interval",
|
||||
native_unit_of_measurement=ENERGY_WATT_HOUR,
|
||||
device_class=SensorDeviceClass.ENERGY,
|
||||
state_class=SensorStateClass.TOTAL,
|
||||
),
|
||||
SensorEntityDescription(
|
||||
key="electricity_produced_interval",
|
||||
name="Electricity Produced Interval",
|
||||
name="Electricity produced interval",
|
||||
native_unit_of_measurement=ENERGY_WATT_HOUR,
|
||||
device_class=SensorDeviceClass.ENERGY,
|
||||
state_class=SensorStateClass.TOTAL,
|
||||
),
|
||||
SensorEntityDescription(
|
||||
key="electricity_produced_peak_interval",
|
||||
name="Electricity Produced Peak Interval",
|
||||
name="Electricity produced peak interval",
|
||||
native_unit_of_measurement=ENERGY_WATT_HOUR,
|
||||
device_class=SensorDeviceClass.ENERGY,
|
||||
state_class=SensorStateClass.TOTAL,
|
||||
),
|
||||
SensorEntityDescription(
|
||||
key="electricity_produced_off_peak_interval",
|
||||
name="Electricity Produced Off Peak Interval",
|
||||
name="Electricity produced off peak interval",
|
||||
native_unit_of_measurement=ENERGY_WATT_HOUR,
|
||||
device_class=SensorDeviceClass.ENERGY,
|
||||
state_class=SensorStateClass.TOTAL,
|
||||
),
|
||||
SensorEntityDescription(
|
||||
key="electricity_consumed_off_peak_point",
|
||||
name="Electricity Consumed Off Peak Point",
|
||||
name="Electricity consumed off peak point",
|
||||
native_unit_of_measurement=POWER_WATT,
|
||||
device_class=SensorDeviceClass.POWER,
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
),
|
||||
SensorEntityDescription(
|
||||
key="electricity_consumed_peak_point",
|
||||
name="Electricity Consumed Peak Point",
|
||||
name="Electricity consumed peak point",
|
||||
native_unit_of_measurement=POWER_WATT,
|
||||
device_class=SensorDeviceClass.POWER,
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
),
|
||||
SensorEntityDescription(
|
||||
key="electricity_consumed_off_peak_cumulative",
|
||||
name="Electricity Consumed Off Peak Cumulative",
|
||||
name="Electricity consumed off peak cumulative",
|
||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
||||
device_class=SensorDeviceClass.ENERGY,
|
||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||
),
|
||||
SensorEntityDescription(
|
||||
key="electricity_consumed_peak_cumulative",
|
||||
name="Electricity Consumed Peak Cumulative",
|
||||
name="Electricity consumed peak cumulative",
|
||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
||||
device_class=SensorDeviceClass.ENERGY,
|
||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||
),
|
||||
SensorEntityDescription(
|
||||
key="electricity_produced_off_peak_point",
|
||||
name="Electricity Produced Off Peak Point",
|
||||
name="Electricity produced off peak point",
|
||||
native_unit_of_measurement=POWER_WATT,
|
||||
device_class=SensorDeviceClass.POWER,
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
),
|
||||
SensorEntityDescription(
|
||||
key="electricity_produced_peak_point",
|
||||
name="Electricity Produced Peak Point",
|
||||
name="Electricity produced peak point",
|
||||
native_unit_of_measurement=POWER_WATT,
|
||||
device_class=SensorDeviceClass.POWER,
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
),
|
||||
SensorEntityDescription(
|
||||
key="electricity_produced_off_peak_cumulative",
|
||||
name="Electricity Produced Off Peak Cumulative",
|
||||
name="Electricity produced off peak cumulative",
|
||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
||||
device_class=SensorDeviceClass.ENERGY,
|
||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||
),
|
||||
SensorEntityDescription(
|
||||
key="electricity_produced_peak_cumulative",
|
||||
name="Electricity Produced Peak Cumulative",
|
||||
name="Electricity produced peak cumulative",
|
||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
||||
device_class=SensorDeviceClass.ENERGY,
|
||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||
),
|
||||
SensorEntityDescription(
|
||||
key="gas_consumed_interval",
|
||||
name="Gas Consumed Interval",
|
||||
name="Gas consumed interval",
|
||||
native_unit_of_measurement=VOLUME_CUBIC_METERS,
|
||||
device_class=SensorDeviceClass.GAS,
|
||||
state_class=SensorStateClass.TOTAL,
|
||||
),
|
||||
SensorEntityDescription(
|
||||
key="gas_consumed_cumulative",
|
||||
name="Gas Consumed Cumulative",
|
||||
name="Gas consumed cumulative",
|
||||
native_unit_of_measurement=VOLUME_CUBIC_METERS,
|
||||
device_class=SensorDeviceClass.GAS,
|
||||
state_class=SensorStateClass.TOTAL,
|
||||
),
|
||||
SensorEntityDescription(
|
||||
key="net_electricity_point",
|
||||
name="Net Electricity Point",
|
||||
name="Net electricity point",
|
||||
native_unit_of_measurement=POWER_WATT,
|
||||
device_class=SensorDeviceClass.POWER,
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
),
|
||||
SensorEntityDescription(
|
||||
key="net_electricity_cumulative",
|
||||
name="Net Electricity Cumulative",
|
||||
name="Net electricity cumulative",
|
||||
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
||||
device_class=SensorDeviceClass.ENERGY,
|
||||
state_class=SensorStateClass.TOTAL,
|
||||
|
@ -237,28 +237,28 @@ SENSORS: tuple[SensorEntityDescription, ...] = (
|
|||
),
|
||||
SensorEntityDescription(
|
||||
key="modulation_level",
|
||||
name="Modulation Level",
|
||||
name="Modulation level",
|
||||
icon="mdi:percent",
|
||||
native_unit_of_measurement=PERCENTAGE,
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
),
|
||||
SensorEntityDescription(
|
||||
key="valve_position",
|
||||
name="Valve Position",
|
||||
name="Valve position",
|
||||
icon="mdi:valve",
|
||||
native_unit_of_measurement=PERCENTAGE,
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
),
|
||||
SensorEntityDescription(
|
||||
key="water_pressure",
|
||||
name="Water Pressure",
|
||||
name="Water pressure",
|
||||
native_unit_of_measurement=PRESSURE_BAR,
|
||||
device_class=SensorDeviceClass.PRESSURE,
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
),
|
||||
SensorEntityDescription(
|
||||
key="humidity",
|
||||
name="Relative Humidity",
|
||||
name="Relative humidity",
|
||||
native_unit_of_measurement=PERCENTAGE,
|
||||
device_class=SensorDeviceClass.HUMIDITY,
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
|
@ -307,7 +307,6 @@ class PlugwiseSensorEntity(PlugwiseEntity, SensorEntity):
|
|||
super().__init__(coordinator, device_id)
|
||||
self.entity_description = description
|
||||
self._attr_unique_id = f"{device_id}-{description.key}"
|
||||
self._attr_name = (f"{self.device.get('name', '')} {description.name}").lstrip()
|
||||
|
||||
@property
|
||||
def native_value(self) -> int | float | None:
|
||||
|
|
|
@ -21,7 +21,7 @@ from .util import plugwise_command
|
|||
SWITCHES: tuple[SwitchEntityDescription, ...] = (
|
||||
SwitchEntityDescription(
|
||||
key="dhw_cm_switch",
|
||||
name="DHW Comfort Mode",
|
||||
name="DHW comfort mode",
|
||||
icon="mdi:water-plus",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
),
|
||||
|
@ -68,7 +68,6 @@ class PlugwiseSwitchEntity(PlugwiseEntity, SwitchEntity):
|
|||
super().__init__(coordinator, device_id)
|
||||
self.entity_description = description
|
||||
self._attr_unique_id = f"{device_id}-{description.key}"
|
||||
self._attr_name = (f"{self.device.get('name', '')} {description.name}").lstrip()
|
||||
|
||||
@property
|
||||
def is_on(self) -> bool | None:
|
||||
|
|
|
@ -1257,7 +1257,7 @@ plexauth==0.0.6
|
|||
plexwebsocket==0.0.13
|
||||
|
||||
# homeassistant.components.plugwise
|
||||
plugwise==0.18.6
|
||||
plugwise==0.18.7
|
||||
|
||||
# homeassistant.components.plum_lightpad
|
||||
plumlightpad==0.0.11
|
||||
|
|
|
@ -871,7 +871,7 @@ plexauth==0.0.6
|
|||
plexwebsocket==0.0.13
|
||||
|
||||
# homeassistant.components.plugwise
|
||||
plugwise==0.18.6
|
||||
plugwise==0.18.7
|
||||
|
||||
# homeassistant.components.plum_lightpad
|
||||
plumlightpad==0.0.11
|
||||
|
|
Loading…
Reference in New Issue