@property
@final
def state(self) -> (Literal[('on', 'off')] | None):
    'Return the state.'
    if ((is_on := self.is_on) is None):
        return None
    return (STATE_ON if is_on else STATE_OFF)
Return the state.
@property
@final
def state(self) -> (Literal[('on', 'off')] | None):
    
    if ((is_on := self.is_on) is None):
        return None
    return (STATE_ON if is_on else STATE_OFF)