def _state_changed(self, state):
logger.debug('<STR_LIT>'.format(state))<EOL>if state == <NUM_LIT:5>:<EOL><INDENT>self._powered_off.clear()<EOL>self._powered_on.set()<EOL><DEDENT>elif state == <NUM_LIT:4>:<EOL><INDENT>self._powered_on.clear()<EOL>self._powered_off.set()<EOL><DEDENT>
Called when the power state changes.