def mainswitch_state(frames):
        """parse a mainswitch.state message"""
        reader = MessageReader(frames)
        res = reader.string("command").bool("state").assert_end().get()
        if res.command != "mainswitch.state":
            raise MessageParserError("Command is not 'mainswitch.state'")
        return (res.state,)
def mainswitch_state ( frames ) : reader = MessageReader ( frames ) res = reader . string ( "command" ) . bool ( "state" ) . assert_end ( ) . get ( ) if res . command != "mainswitch.state" : raise MessageParserError ( "Command is not 'mainswitch.state'" ) return ( res . state , )
parse a mainswitch.state message