Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
perosb committed Oct 22, 2017
1 parent e233573 commit df3d5a6
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions homeassistant/components/google_assistant/smart_home.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,13 @@ def entity_to_device(entity: Entity):
light.ATTR_MAX_MIREDS) is not None:
device['attributes']['temperatureMinK'] = \
int(round(color.color_temperature_mired_to_kelvin(
entity.attributes.get(light.ATTR_MAX_MIREDS))))
entity.attributes.get(light.ATTR_MAX_MIREDS))))

if entity.attributes.get(
light.ATTR_MIN_MIREDS) is not None:
device['attributes']['temperatureMaxK'] = \
int(round(color.color_temperature_mired_to_kelvin(
entity.attributes.get(light.ATTR_MIN_MIREDS))))
entity.attributes.get(light.ATTR_MIN_MIREDS))))

_LOGGER.debug(device)
return device
Expand Down Expand Up @@ -198,8 +198,10 @@ def determine_service(entity_id: str, command: str,
return (SERVICE_TURN_ON, service_data)
if color_data.get('spectrumRGB', 0) > 0:
# blue is 255 so pad up to 6
hex = ('%0x' % int(color_data.get('spectrumRGB'))).zfill(6)
service_data['rgb_color'] = color.rgb_hex_to_rgb_list(hex)
hex_value = \
('%0x' % int(color_data.get('spectrumRGB'))).zfill(6)
service_data['rgb_color'] = \
color.rgb_hex_to_rgb_list(hex_value)
return (SERVICE_TURN_ON, service_data)

if command == COMMAND_ACTIVATESCENE:
Expand All @@ -210,4 +212,4 @@ def determine_service(entity_id: str, command: str,
return (SERVICE_TURN_ON, service_data)
else:
return (SERVICE_TURN_OFF, service_data)
return (None, service_data)
return (None, service_data)

0 comments on commit df3d5a6

Please sign in to comment.