philippelt / netatmo-api-python

Netatmo connect API python client (for Netatmo information, see https://dev.netatmo.com)
GNU General Public License v3.0
186 stars 118 forks source link

Thermostat not working #65

Closed JurgenLB closed 8 months ago

JurgenLB commented 9 months ago

Is there anyone who is using the "Thermostat" Class ? For me this was not working. I have changed some of the code and now I can use the data from Relay and Thermostat.

#        self.thermostatData = filter_home_data(self.rawData, home)
#        if not self.thermostatData : raise NoHome("No home %s found" % home)
        # OLD API
        # Standard the first Relaystation and Thermostat is returned   
        # self.rawData is list all station
        for Relay in self.rawData:
            self.Relay_Plug = Relay     # only last will be returnd
            for thermostat in Relay['modules']:
                self.thermostat
        self.defaultThermostat = thermostat['module_name']  #self.the$
        self.defaultThermostatId = thermostat['_id']
#        self.defaultModule = thermostat['modules'][0]

I think it is even better to do ` def Relay_Plug(self): for Relay in self.rawData: return Relay

def Thermostat_Data(self):    
        for thermostat in self.Relay_Plug['modules']:
            return thermostat

` maybe there is even some checking necessary

I find it strange that the 'keywords' are different, but that is possible because of multiple kinds of thermostat

Kind regards

JurgenLB commented 8 months ago

this is resolved in #71