Skip to content

Commit

Permalink
remove deviceInfo as not part of a device state (PR #10399)
Browse files Browse the repository at this point in the history
  • Loading branch information
perosb committed Nov 8, 2017
1 parent a09cecb commit 7cd2463
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions homeassistant/components/google_assistant/smart_home.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,26 +74,13 @@ def entity_to_device(entity: Entity):
device = {
'id': entity.entity_id,
'name': {},
'deviceInfo': {},
'attributes': {},
'traits': [],
'willReportState': False,
}
device['type'] = class_data[0]
device['traits'].append(class_data[1])

if entity.attributes.get('manufacturer') is not None:
device['deviceInfo']['manufacturer'] = \
entity.attributes.get('manufacturer')

if entity.attributes.get('model_number') is not None:
device['deviceInfo']['model'] = \
entity.attributes.get('model_number')

if entity.attributes.get('firmware_version') is not None:
device['deviceInfo']['swVersion'] = \
entity.attributes.get('firmware_version')

# handle custom names
device['name']['name'] = \
entity.attributes.get(ATTR_GOOGLE_ASSISTANT_NAME) or \
Expand Down Expand Up @@ -221,7 +208,7 @@ def determine_service(entity_id: str, command: str,
service_data[light.ATTR_KELVIN] = color_data.get('temperature')
return (SERVICE_TURN_ON, service_data)
if color_data.get('spectrumRGB', 0) > 0:
# blue is 255 so pad up to 6
# blue is 255 so pad up to 6 chars
hex_value = \
('%0x' % int(color_data.get('spectrumRGB'))).zfill(6)
service_data[light.ATTR_RGB_COLOR] = \
Expand Down

0 comments on commit 7cd2463

Please sign in to comment.