Alexa strict type hints (#97485)

* Enable strict typing

* Adjustments for stict typing
This commit is contained in:
Jan Bouwhuis 2023-08-08 17:15:25 +02:00 committed by GitHub
parent 9910da2f3d
commit 500d9a4da0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 37 additions and 18 deletions

View file

@ -280,9 +280,10 @@ class AlexaEntity:
def friendly_name(self) -> str:
"""Return the Alexa API friendly name."""
return self.entity_conf.get(CONF_NAME, self.entity.name).translate(
TRANSLATION_TABLE
)
friendly_name: str = self.entity_conf.get(
CONF_NAME, self.entity.name
).translate(TRANSLATION_TABLE)
return friendly_name
def description(self) -> str:
"""Return the Alexa API description."""
@ -725,7 +726,7 @@ class MediaPlayerCapabilities(AlexaEntity):
class SceneCapabilities(AlexaEntity):
"""Class to represent Scene capabilities."""
def description(self):
def description(self) -> str:
"""Return the Alexa API description."""
description = AlexaEntity.description(self)
if "scene" not in description.casefold():