def brightness(self):
        """Return the brightness of this light between 0..255."""
        val = None
        if self._prop_brightness:
            val = self._prop_brightness.from_device(self.device)
        if val is None:
            return None
        rmx = 100
        if self._prop_brightness.value_range:
            rmx = self._prop_brightness.range_max()
        return round(255 / rmx * int(val))
Return the brightness of this light between 0..255.
custom_components/xiaomi_miot/light.py