'Retrieve latest state.'

def update(self):

    self._unit = SENSOR_UNITS.get(self.variable, None)
    if (self.variable == 'operation_mode'):
        self._state = getattr(self.device, 'mode')
    else:
        self._state = getattr(self.device, self.variable)
