'Get the latest data from the fritz box.'

def update(self):

    from requests.exceptions import RequestException
    try:
        actor = self.fritz.get_actor_by_ain(self.ain)
        self.state = actor.get_state()
    except RequestException:
        _LOGGER.error('Request    to    actor    failed')
        self.state = STATE_UNKNOWN
        self.temperature = STATE_UNKNOWN
        self.current_consumption = STATE_UNKNOWN
        self.total_consumption = STATE_UNKNOWN
        return
    self.temperature = actor.temperature
    self.current_consumption = ((actor.get_power() or 0.0) / 1000)
    self.total_consumption = ((actor.get_energy() or 0.0) / 100000)
    self.has_switch = actor.has_switch
    self.has_temperature = actor.has_temperature
    self.has_powermeter = actor.has_powermeter
