<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def state(self, state):
 """Set state."""

        self._state = state
        self._manager[ATTR_STATE] = state
        _LOGGER.info('state changed to %s', state)