mirror of
https://github.com/home-assistant/core.git
synced 2025-07-17 18:27:09 +00:00
cache name in entity so we can display it even if the connection is lost (#6176)
update tellduslive dependency check return value from update
This commit is contained in:
parent
827e3c4395
commit
6127173d2a
@ -17,7 +17,7 @@ import voluptuous as vol
|
|||||||
|
|
||||||
DOMAIN = 'tellduslive'
|
DOMAIN = 'tellduslive'
|
||||||
|
|
||||||
REQUIREMENTS = ['tellduslive==0.3.2']
|
REQUIREMENTS = ['tellduslive==0.3.4']
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
@ -104,7 +104,8 @@ class TelldusLiveClient(object):
|
|||||||
|
|
||||||
def _sync(self):
|
def _sync(self):
|
||||||
"""Update local list of devices."""
|
"""Update local list of devices."""
|
||||||
self._client.update()
|
if not self._client.update():
|
||||||
|
_LOGGER.warning('Failed request')
|
||||||
|
|
||||||
def identify_device(device):
|
def identify_device(device):
|
||||||
"""Find out what type of HA component to create."""
|
"""Find out what type of HA component to create."""
|
||||||
@ -160,10 +161,13 @@ class TelldusLiveEntity(Entity):
|
|||||||
self._id = device_id
|
self._id = device_id
|
||||||
self._client = hass.data[DOMAIN]
|
self._client = hass.data[DOMAIN]
|
||||||
self._client.entities.append(self)
|
self._client.entities.append(self)
|
||||||
|
self._name = self.device.name
|
||||||
_LOGGER.debug('Created device %s', self)
|
_LOGGER.debug('Created device %s', self)
|
||||||
|
|
||||||
def changed(self):
|
def changed(self):
|
||||||
"""A property of the device might have changed."""
|
"""A property of the device might have changed."""
|
||||||
|
if self.device.name:
|
||||||
|
self._name = self.device.name
|
||||||
self.schedule_update_ha_state()
|
self.schedule_update_ha_state()
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@ -194,7 +198,7 @@ class TelldusLiveEntity(Entity):
|
|||||||
@property
|
@property
|
||||||
def name(self):
|
def name(self):
|
||||||
"""Return name of device."""
|
"""Return name of device."""
|
||||||
return self.device.name or DEVICE_DEFAULT_NAME
|
return self._name or DEVICE_DEFAULT_NAME
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def available(self):
|
def available(self):
|
||||||
|
@ -688,7 +688,7 @@ steamodd==4.21
|
|||||||
tellcore-py==1.1.2
|
tellcore-py==1.1.2
|
||||||
|
|
||||||
# homeassistant.components.tellduslive
|
# homeassistant.components.tellduslive
|
||||||
tellduslive==0.3.2
|
tellduslive==0.3.4
|
||||||
|
|
||||||
# homeassistant.components.sensor.temper
|
# homeassistant.components.sensor.temper
|
||||||
temperusb==1.5.1
|
temperusb==1.5.1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user