rospogrigio / daikin_residential

Cloud control of Daikin devices that are supported by Daikin Residential Controller app.
GNU General Public License v3.0
283 stars 37 forks source link

The field econoMode doesn't appear in the json #27

Closed medhy397 closed 2 years ago

medhy397 commented 2 years ago

Bonjour,

With one of my units BRP069C4X (firmware 1_12_43) the field econoMode doesn't exist so I have got an error in daikin_api.py [line 518] and the entity climate.my_aircon is never created

but with the other units the field is there and everything works.

So to have your code working with all my units, I change a little bit some lines at the end of daikin_api.py but I'm not an expert so it's just for information :

            if "econoMode" in dev_data["managementPoints"][1]:
                if dev_data["managementPoints"][1]["econoMode"]["value"] == "on":
                    _mode = "eco"
                elif dev_data["managementPoints"][1]["powerfulMode"]["value"] == "on":
                    _mode = "powerful"
                else:
                    _mode = "none"
            else:
                if dev_data["managementPoints"][1]["powerfulMode"]["value"] == "on":
                    _mode = "powerful"
                else:
                    _mode = "none"
rospogrigio commented 2 years ago

@medhy397 can you please test if PR #28 fixes this? Thank you

medhy397 commented 2 years ago

@medhy397 can you please test if PR #28 fixes this? Thank you

yep, it works fine with #28, thanks

lours1 commented 2 years ago

@medhy397 can you please test if PR #28 fixes this? Thank you

I got the same issaue that @medhy397 and your fix work also for me