#NEWLINE# def sync( self ) : #NEWLINE# #INDENT# 'Update the state of a light.' #NEWLINE# match = LIGHT_ID_RE . match ( self . key . id ( ) ) #NEWLINE# bridge_id = match . group ( 1 ) #NEWLINE# device_id = int ( match . group ( 2 ) ) #NEWLINE# event = { #NEWLINE# #INDENT# 'type' : 'hue' , #NEWLINE# 'command' : 'set_state' , #NEWLINE# 'bridge_id' : bridge_id , #NEWLINE# 'device_id' : device_id , #NEWLINE# 'mode' : self . state , #NEWLINE# 'brightness' : self . brightness , #NEWLINE# 'color_temperature' : self . color_temperature , #NEWLINE# #UNINDENT# } #NEWLINE# pushrpc . send_event ( event )