def _on_light_state(self, header, payload, rest, addr):
with self.lock:<EOL><INDENT>label = payload['<STR_LIT:label>'].strip('<STR_LIT:\x00>')<EOL>self.bulbs[header.mac] = bulb = Bulb(label, header.mac)<EOL>if len(self.bulbs) >= self.num_bulbs:<EOL><INDENT>self.bulbs_found_event.set()<EOL><DEDENT>self.light_state[header.mac] = payload<EOL>if len(self.light_state) >= self.num_bulbs:<EOL><INDENT>self.light_state_event.set()<EOL><DEDENT><DEDENT>self.callbacks.put(EVENT_LIGHT_STATE, bulb,<EOL>raw=payload,<EOL>hue=(payload['<STR_LIT>'] / float(<NUM_LIT>) * <NUM_LIT>) % <NUM_LIT>,<EOL>saturation=payload['<STR_LIT>'] / float(<NUM_LIT>),<EOL>brightness=payload['<STR_LIT>'] / float(<NUM_LIT>),<EOL>kelvin=payload['<STR_LIT>'],<EOL>is_on=bool(payload['<STR_LIT>']))<EOL>
Records the light state of bulbs, and forwards to a high-level callback
with human-friendlier arguments.