'Read the current state of the device from the tellcore library.'

def _update_from_tellcore(self):

    from tellcore.library import TelldusError
    from tellcore.constants import TELLSTICK_TURNON, TELLSTICK_TURNOFF, TELLSTICK_DIM
    with TELLSTICK_LOCK:
        try:
            last_command = self._tellcore_device.last_sent_command(((TELLSTICK_TURNON | TELLSTICK_TURNOFF) | TELLSTICK_DIM))
            last_data = self._tellcore_device.last_sent_value()
            self._update_model_from_command(last_command, last_data)
        except TelldusError as err:
            _LOGGER.error(err)
