#NEWLINE# def convert_rgb_to_hsv( rgb ) : #NEWLINE# #INDENT# 'Convert Home Assistant RGB values to HSV values.' #NEWLINE# ( red , green , blue ) = [ ( _ / BYTE_MAX ) for _ in rgb ] #NEWLINE# ( hue , saturation , brightness ) = colorsys . rgb_to_hsv ( rgb , green , blue ) #NEWLINE# return [ int ( ( hue * SHORT_MAX ) ) , int ( ( saturation * SHORT_MAX ) ) , int ( ( brightness * SHORT_MAX ) ) ]