def __init__(self, name, state): self.name = name assert state in power_state.valid_states(), "Bad state: %s" % state self.state = state