Make Alexa custom ID unique (#44839)
* Make Alexa custom ID unique * Lint * Lint
This commit is contained in:
parent
16e1046dbc
commit
69b5176730
10 changed files with 83 additions and 20 deletions
|
@ -45,6 +45,11 @@ class AbstractConfig(ABC):
|
|||
"""Return if proactive mode is enabled."""
|
||||
return self._unsub_proactive_report is not None
|
||||
|
||||
@callback
|
||||
@abstractmethod
|
||||
def user_identifier(self):
|
||||
"""Return an identifier for the user that represents this config."""
|
||||
|
||||
async def async_enable_proactive_mode(self):
|
||||
"""Enable proactive mode."""
|
||||
if self._unsub_proactive_report is None:
|
||||
|
|
|
@ -329,7 +329,7 @@ class AlexaEntity:
|
|||
"manufacturer": "Home Assistant",
|
||||
"model": self.entity.domain,
|
||||
"softwareVersion": __version__,
|
||||
"customIdentifier": self.entity_id,
|
||||
"customIdentifier": f"{self.config.user_identifier()}-{self.entity_id}",
|
||||
},
|
||||
}
|
||||
|
||||
|
|
|
@ -53,6 +53,11 @@ class AlexaConfig(AbstractConfig):
|
|||
"""Return config locale."""
|
||||
return self._config.get(CONF_LOCALE)
|
||||
|
||||
@core.callback
|
||||
def user_identifier(self):
|
||||
"""Return an identifier for the user that represents this config."""
|
||||
return ""
|
||||
|
||||
def should_expose(self, entity_id):
|
||||
"""If an entity should be exposed."""
|
||||
return self._config[CONF_FILTER](entity_id)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue