You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
Was wondering in discovery why you check for the case where you get > 1 thermostats but only return the first? Why not just return the thermostats as a list?
if len(thermostats) > 1:
raise IOError("Found %d thermostats and I don't know which to pick." % len(thermostats))
return thermostats[0]
Thanks for the library.
Todd
The text was updated successfully, but these errors were encountered:
I think this was only because there wasn't a good way (or maybe any way) to help the user determine which thermostat is which. The expectation is that the user will have a known hostname or IP address for each thermostat. Otherwise, how do you know which one you're interacting with?
Perhaps if each is a different model, that would give you a way to tell them apart. Seems like an edge case though.
Ideas are welcome. If you want to implement multiple-thermostat discovery, that's fine with me as long as we have a clear user story.
discovery could query the name of the thermostat(s) and return the name, model etc, but personally I think the calling application should be responsible for associating the IP(s) with the location of an individual thermostat.
for index, tstat_host in enumerate(radiotherm.discover.discover_address()):
tstats.append(radiotherm.get_thermostat(tstat_host))
print(tstats[index].name)
{'raw': 'upstairs'}
{'raw': 'downstairs'}
Hi,
Was wondering in discovery why you check for the case where you get > 1 thermostats but only return the first? Why not just return the thermostats as a list?
Thanks for the library.
Todd
The text was updated successfully, but these errors were encountered: