def homeautoswitch(self, cmd, ain=None):
        """
        Call a switch method.
        Should only be used by internal library functions.
        """
        assert self.sid, "Not logged in"
        params = {
            'switchcmd': cmd,
            'sid': self.sid,
        }
        if ain:
            params['ain'] = ain
        url = self.base_url + '/webservices/homeautoswitch.lua'
        response = self.session.get(url, params=params)
        response.raise_for_status()
        return response.text.strip()
dataset/ETHPy150Open DerMitch/fritzbox-smarthome/fritzhome/fritz.py/FritzBox.homeautoswitch/original