code: def brightness_to_hex(self, level):
          
          level_int = int(level)
          new_int = int((level_int * 255)/100)
          new_level = format(new_int, '02X')
          self.logger.debug("brightness_to_hex: %s to %s", level, str(new_level))
          return str(new_level)
docs: Convert numeric brightness percentage into hex for insteon