def _get_hs_from_properties(self):
    rgb = self._properties.get('rgb', None)
    color_mode = self._properties.get('color_mode', None)
    if ((not rgb) or (not color_mode)):
        return None
    color_mode = int(color_mode)
    if (color_mode == 2):
        temp_in_k = mired_to_kelvin(self._color_temp)
        return color_util.color_temperature_to_hs(temp_in_k)
    if (color_mode == 3):
        hue = int(self._properties.get('hue'))
        sat = int(self._properties.get('sat'))
        return (((hue / 360) * 65536), ((sat / 100) * 255))
    rgb = int(rgb)
    blue = (rgb & 255)
    green = ((rgb >> 8) & 255)
    red = ((rgb >> 16) & 255)
    return color_util.color_RGB_to_hs(red, green, blue)
def _get_hs_from_properties(self):
    rgb = self._properties.get('rgb', None)
    color_mode = self._properties.get('color_mode', None)
    if ((not rgb) or (not color_mode)):
        return None
    color_mode = int(color_mode)
    if (color_mode == 2):
        temp_in_k = mired_to_kelvin(self._color_temp)
        return color_util.color_temperature_to_hs(temp_in_k)
    if (color_mode == 3):
        hue = int(self._properties.get('hue'))
        sat = int(self._properties.get('sat'))
        return (((hue / 360) * 65536), ((sat / 100) * 255))
    rgb = int(rgb)
    blue = (rgb & 255)
    green = ((rgb >> 8) & 255)
    red = ((rgb >> 16) & 255)
    return color_util.color_RGB_to_hs(red, green, blue)