mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
parent
34090bd021
commit
717a0c2b2d
@ -116,10 +116,17 @@ class TelldusLiveEntity(Entity):
|
|||||||
def device_info(self):
|
def device_info(self):
|
||||||
"""Return device info."""
|
"""Return device info."""
|
||||||
device = self._client.device_info(self.device.device_id)
|
device = self._client.device_info(self.device.device_id)
|
||||||
return {
|
device_info = {
|
||||||
'identifiers': {('tellduslive', self.device.device_id)},
|
'identifiers': {('tellduslive', self.device.device_id)},
|
||||||
'name': self.device.name,
|
'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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user