Skip to content

Commit

Permalink
feat: Add support for non-Amazon switches and plugs (#2204)
Browse files Browse the repository at this point in the history
  • Loading branch information
SRGDamia1 committed Mar 6, 2024
1 parent 66a2082 commit 2344bcf
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions custom_components/alexa_media/alexa_entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,10 @@ def is_switch(appliance: dict[str, Any]) -> bool:
"""Is the given appliance a switch controlled locally by an Echo."""
return (
is_local(appliance)
and "SMARTPLUG" in appliance.get("applianceTypes", [])
and appliance["manufacturerName"] == "Amazon"
and (
"SMARTPLUG" in appliance.get("applianceTypes", [])
or "SWITCH" in appliance.get("applianceTypes", [])
)
and has_capability(appliance, "Alexa.PowerController", "powerState")
)

Expand Down

0 comments on commit 2344bcf

Please sign in to comment.