Skip to content

Commit

Permalink
Fix broken tuple
Browse files Browse the repository at this point in the history
A value that used to be a tuple was accidentally converted to a string
  • Loading branch information
jason0x43 committed May 1, 2020
1 parent 8902b01 commit adca721
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions custom_components/hubitat/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ async def async_turn_off(self, **kwargs) -> None:


LIGHT_CAPABILITIES = (CAP_COLOR_TEMP, CAP_COLOR_CONTROL, CAP_LIGHT, CAP_SWITCH_LEVEL)
POSSIBLE_LIGHT_CAPABILITIES = CAP_SWITCH
POSSIBLE_LIGHT_CAPABILITIES = (CAP_SWITCH,)

# Ideally this would be multi-lingual
MATCH_LIGHT = re.compile(
Expand All @@ -157,14 +157,11 @@ async def async_turn_off(self, **kwargs) -> None:
def is_light(device: Device) -> bool:
"""Return True if device looks like a light."""
if any(cap in device.capabilities for cap in LIGHT_CAPABILITIES):
_LOGGER.debug(f"{device.name} has a light capability")
return True
if any(
cap in device.capabilities for cap in POSSIBLE_LIGHT_CAPABILITIES
) and MATCH_LIGHT.match(device.name):
_LOGGER.debug(f"{device.name} has a light name")
return True
_LOGGER.debug(f"{device.name} is not a light")
return False


Expand Down

0 comments on commit adca721

Please sign in to comment.