Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Alexa discovery description #26933

Merged
merged 4 commits into from Sep 27, 2019

Conversation

@bramkragten
Copy link
Member

commented Sep 26, 2019

Closes #26927

@@ -138,7 +138,9 @@ def friendly_name(self):

def description(self):
"""Return the Alexa API description."""
return self.entity_conf.get(CONF_DESCRIPTION, self.entity.entity_id)
return self.entity_conf.get(CONF_DESCRIPTION) or "{} via Home Assistant".format(

This comment has been minimized.

Copy link
@MartinHjelmare

MartinHjelmare Sep 26, 2019

Member

Please use f-strings instead of str.format.

This comment has been minimized.

Copy link
@pvizeli

pvizeli Sep 26, 2019

Member

Maybe entity domain instead friendly name?

This comment has been minimized.

Copy link
@balloob

balloob Sep 26, 2019

Member

Let's use entity_id, friendly name is already set as name. This is really to help users find their way back which entity it is in HA.

Dev automation moved this from Needs review to Review in progress Sep 26, 2019
Dev automation moved this from Review in progress to Reviewer approved Sep 27, 2019
@pvizeli

This comment has been minimized.

Copy link
Member

commented Sep 27, 2019

I liked the first variant more and like @balloob said, with entity_id

@bramkragten

This comment has been minimized.

Copy link
Member Author

commented Sep 27, 2019

Which variant?

@@ -138,7 +138,8 @@ def friendly_name(self):

def description(self):
"""Return the Alexa API description."""
return self.entity_conf.get(CONF_DESCRIPTION, self.entity.entity_id)
description = self.entity_conf.get(CONF_DESCRIPTION) or self.entity_id
return f"{description} via Home Assistant"

This comment has been minimized.

Copy link
@balloob

balloob Sep 27, 2019

Member

If a description is set, we shouldn't add text to it.

This comment has been minimized.

Copy link
@bramkragten

bramkragten Sep 27, 2019

Author Member

It is required by Alexa to show how it is connected, just like it is required to include "scene" for scenes.

This comment has been minimized.

Copy link
@balloob

balloob Sep 27, 2019

Member

ah okay.

Can we also filter out characters that are not allowed ?

@bramkragten bramkragten merged commit 80bc15e into dev Sep 27, 2019
11 checks passed
11 checks passed
CI Build #20190927.51 succeeded
Details
CI (FullCheck Mypy) FullCheck Mypy succeeded
Details
CI (FullCheck Pylint) FullCheck Pylint succeeded
Details
CI (Overview CheckFormat) Overview CheckFormat succeeded
Details
CI (Overview Lint) Overview Lint succeeded
Details
CI (Overview Validate) Overview Validate succeeded
Details
CI (Tests PyTest Python36) Tests PyTest Python36 succeeded
Details
CI (Tests PyTest Python37) Tests PyTest Python37 succeeded
Details
cla-bot Everyone involved has signed the CLA
codecov/patch 100% of diff hit (target 94.18%)
Details
codecov/project 94.19% (target 90%)
Details
Dev automation moved this from Reviewer approved to Done Sep 27, 2019
@delete-merged-branch delete-merged-branch bot deleted the alexa-description branch Sep 27, 2019
@lock lock bot locked and limited conversation to collaborators Sep 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Dev
  
Done
5 participants
You can’t perform that action at this time.