From dd41b4cefd8f6ed47bcb0e478621535b6dbbd2be Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Thu, 19 Feb 2026 13:40:09 +0100 Subject: [PATCH] Use shorthand attribute in tellstick toggle entities (#163443) --- homeassistant/components/tellstick/entity.py | 6 ------ homeassistant/components/tellstick/light.py | 6 +++--- homeassistant/components/tellstick/switch.py | 2 +- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/homeassistant/components/tellstick/entity.py b/homeassistant/components/tellstick/entity.py index 5be3d1f48f4..966f84c8549 100644 --- a/homeassistant/components/tellstick/entity.py +++ b/homeassistant/components/tellstick/entity.py @@ -30,7 +30,6 @@ class TellstickDevice(Entity): def __init__(self, tellcore_device, signal_repetitions): """Init the Tellstick device.""" self._signal_repetitions = signal_repetitions - self._state = None self._requested_state = None self._requested_data = None self._repeats_left = 0 @@ -48,11 +47,6 @@ class TellstickDevice(Entity): ) ) - @property - def is_on(self): - """Return true if the device is on.""" - return self._state - def _parse_ha_data(self, kwargs): """Turn the value from HA into something useful.""" raise NotImplementedError diff --git a/homeassistant/components/tellstick/light.py b/homeassistant/components/tellstick/light.py index 0b7878cd10e..72ff8e4df05 100644 --- a/homeassistant/components/tellstick/light.py +++ b/homeassistant/components/tellstick/light.py @@ -74,11 +74,11 @@ class TellstickLight(TellstickDevice, LightEntity): # _brightness is not defined when called from super try: - self._state = self._brightness > 0 + self._attr_is_on = self._brightness > 0 except AttributeError: - self._state = True + self._attr_is_on = True else: - self._state = False + self._attr_is_on = False def _send_device_command(self, requested_state, requested_data): """Let tellcore update the actual device to the requested state.""" diff --git a/homeassistant/components/tellstick/switch.py b/homeassistant/components/tellstick/switch.py index fc9a44ef66c..6179daa3f24 100644 --- a/homeassistant/components/tellstick/switch.py +++ b/homeassistant/components/tellstick/switch.py @@ -53,7 +53,7 @@ class TellstickSwitch(TellstickDevice, SwitchEntity): def _update_model(self, new_state, data): """Update the device entity state to match the arguments.""" - self._state = new_state + self._attr_is_on = new_state def _send_device_command(self, requested_state, requested_data): """Let tellcore update the actual device to the requested state."""