arska / controlmyspa

Python library for Balboa ControlMySpa.com
https://pypi.org/project/controlmyspa/
MIT License
5 stars 4 forks source link

Support for Chromazon3 #37

Closed garysargentpersonal closed 6 months ago

garysargentpersonal commented 1 year ago

My tub has Chomazon3 lights - see https://www.balboawatergroup.com/Chromazon3

To get these to turn on, I had to create a method like the existing set_light one as below...

def set_chromazon3(self, state=False):
        """
        Enable/disable Chromeazon3 lights
        :param state: False to turn off, True to turn on
        """
        response = requests.post(
            "https://iot.controlmyspa.com/mobile/control/"
            + self._info["_id"]
            + "/tzl/setPower",
            json={
                "desiredState": ("ON" if state else "OFF"),
            },
            headers={"Authorization": "Bearer " + self._token["access_token"]},
        )
        response.raise_for_status()
        # update the local info
        self._get_info()