From 61b02e9c66e127917a1682eb2ffe19a44d5946f6 Mon Sep 17 00:00:00 2001 From: Joost Lekkerkerker Date: Wed, 6 Sep 2023 23:34:39 +0200 Subject: [PATCH] Use shorthand attributes in Progetti (#99772) Use shorthand attributes in Progetti shorthand --- homeassistant/components/progettihwsw/binary_sensor.py | 7 +------ homeassistant/components/progettihwsw/switch.py | 7 +------ 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/homeassistant/components/progettihwsw/binary_sensor.py b/homeassistant/components/progettihwsw/binary_sensor.py index e2d1025cc64..ea7a7dce5c3 100644 --- a/homeassistant/components/progettihwsw/binary_sensor.py +++ b/homeassistant/components/progettihwsw/binary_sensor.py @@ -62,14 +62,9 @@ class ProgettihwswBinarySensor(CoordinatorEntity, BinarySensorEntity): def __init__(self, coordinator, name, sensor: Input) -> None: """Set initializing values.""" super().__init__(coordinator) - self._name = name + self._attr_name = name self._sensor = sensor - @property - def name(self): - """Return the sensor name.""" - return self._name - @property def is_on(self): """Get sensor state.""" diff --git a/homeassistant/components/progettihwsw/switch.py b/homeassistant/components/progettihwsw/switch.py index 77cfb6ba4d1..f466e11a1cc 100644 --- a/homeassistant/components/progettihwsw/switch.py +++ b/homeassistant/components/progettihwsw/switch.py @@ -64,7 +64,7 @@ class ProgettihwswSwitch(CoordinatorEntity, SwitchEntity): """Initialize the values.""" super().__init__(coordinator) self._switch = switch - self._name = name + self._attr_name = name async def async_turn_on(self, **kwargs: Any) -> None: """Turn the switch on.""" @@ -81,11 +81,6 @@ class ProgettihwswSwitch(CoordinatorEntity, SwitchEntity): await self._switch.toggle() await self.coordinator.async_request_refresh() - @property - def name(self): - """Return the switch name.""" - return self._name - @property def is_on(self): """Get switch state."""