From 9b29cbd71ca486bf8fc253cbc52e6efb45055e39 Mon Sep 17 00:00:00 2001 From: Joost Lekkerkerker Date: Tue, 18 Jul 2023 09:44:47 +0200 Subject: [PATCH] Migrate Home plus control to has entity name (#96596) --- homeassistant/components/home_plus_control/switch.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/homeassistant/components/home_plus_control/switch.py b/homeassistant/components/home_plus_control/switch.py index 6e92fac3b72..99766ebfec9 100644 --- a/homeassistant/components/home_plus_control/switch.py +++ b/homeassistant/components/home_plus_control/switch.py @@ -66,17 +66,15 @@ class HomeControlSwitchEntity(CoordinatorEntity, SwitchEntity): consumption methods and state attributes. """ + _attr_has_entity_name = True + _attr_name = None + def __init__(self, coordinator, idx): """Pass coordinator to CoordinatorEntity.""" super().__init__(coordinator) self.idx = idx self.module = self.coordinator.data[self.idx] - @property - def name(self): - """Name of the device.""" - return self.module.name - @property def unique_id(self): """ID (unique) of the device.""" @@ -92,7 +90,7 @@ class HomeControlSwitchEntity(CoordinatorEntity, SwitchEntity): }, manufacturer="Legrand", model=HW_TYPE.get(self.module.hw_type), - name=self.name, + name=self.module.name, sw_version=self.module.fw, )