bdraco / nexia

Python library for connecting to nexia
Apache License 2.0
21 stars 13 forks source link

Path to zone json is incorrect on XL950 #5

Closed logicfail closed 3 years ago

logicfail commented 3 years ago

On line: https://github.com/bdraco/nexia/blob/master/nexia/home.py#L423

The path to the list of thermostat's was not accurate for my XL950, on an account with only 1 HVAC system. The code would have to be updated as follows to work on my unit:

def _extract_devices_from_houses_json(json_dict: dict):
    """Extras the payload from the houses json endpoint data."""
    return json_dict["result"]["_links"]["child"][DEVICES_ELEMENT]["data"]

Note the removal of the "items" key at the end. I was able to work around this by manually creating the NexiaThermostat object with the appropriate json subkey.