mirror of
https://github.com/andvikt/mega_hacs.git
synced 2025-12-11 17:14:28 +05:00
add name cusomisation for multiple sensors
This commit is contained in:
@@ -76,7 +76,10 @@ class BaseMegaEntity(CoordinatorEntity, RestoreEntity):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def name(self):
|
def name(self):
|
||||||
return self.customize.get(CONF_NAME) or self._name or f"{self.mega.id}_p{self.port}"
|
c = self.customize.get(CONF_NAME)
|
||||||
|
if not isinstance(c, str):
|
||||||
|
c = self._name or f"{self.mega.id}_p{self.port}"
|
||||||
|
return c
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def unique_id(self):
|
def unique_id(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user