Skip to content

Commit

Permalink
fix #20387 devices without model/protocol (#20530)
Browse files Browse the repository at this point in the history
  • Loading branch information
fredrike authored and balloob committed Jan 29, 2019
1 parent 34090bd commit 717a0c2
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions homeassistant/components/tellduslive/entry.py
Expand Up @@ -116,10 +116,17 @@ def unique_id(self) -> str:
def device_info(self):
"""Return device info."""
device = self._client.device_info(self.device.device_id)
return {
device_info = {
'identifiers': {('tellduslive', self.device.device_id)},
'name': self.device.name,
'model': device['model'].title(),
'manufacturer': device['protocol'].title(),
'via_hub': ('tellduslive', device.get('client')),
}
model = device.get('model')
if model is not None:
device_info['model'] = model.title()
protocol = device.get('protocol')
if protocol is not None:
device_info['manufacturer'] = protocol.title()
client = device.get('client')
if client is not None:
device_info['via_hub'] = ('tellduslive', client)
return device_info

0 comments on commit 717a0c2

Please sign in to comment.