parse a mainswitch.state message

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,)