'Update device state.'

def update(self):

    super().update()
    if self.has_attribute('brightness_state'):
        value = self.value('brightness_state')
        if (value is not None):
            self._brightness = int.from_bytes(value, byteorder='little')
            _LOGGER.debug('%s:    brightness    =    %d', self.name, self._brightness)
    if self.has_attribute('state'):
        self._state = self.value('state')[0]
        _LOGGER.debug('%s:    state    =    %d', self.name, self._state)
