'Update the internal state of this device.'

def value_changed(self, val):

    self._brightness = math.floor(((val / 100.0) * 256.0))
    self._on_state = bool((val != 0))
    self.schedule_update_ha_state()
