Replace lists with tuples (2) (#53685)

This commit is contained in:
Marc Mueller 2021-07-30 01:20:03 +02:00 committed by GitHub
parent 5eba3e485b
commit 0815eede4b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
61 changed files with 137 additions and 139 deletions

View file

@ -79,9 +79,9 @@ def get_device_connection(
def get_resource(domain_name: str, domain_data: ConfigType) -> str:
"""Return the resource for the specified domain_data."""
if domain_name in ["switch", "light"]:
if domain_name in ("switch", "light"):
return cast(str, domain_data["output"])
if domain_name in ["binary_sensor", "sensor"]:
if domain_name in ("binary_sensor", "sensor"):
return cast(str, domain_data["source"])
if domain_name == "cover":
return cast(str, domain_data["motor"])