Closed vickyg3 closed 7 years ago
Thanks for this! Python isn't my day-job language so I've still got a lot to learn. :-)
Thanks for the quick merge. :)
This was causing trouble with my HomeAssistant instance because it had a nest thermostat and it was failing by the call to _new_sensor() on the thermostat which was unnecessary. Any idea on if you can update pypi with this change so that i can bump up the dependency on HA ?
Sure! I pushed 0.11.7 for you. I'll need to make another PR in HA...
Awesome, thanks. I can do the PR on HA.
When using a dictionary to return the value based on generic_type, all the cases are executed when creating the dictionary (i.e. all the objects will be created and the right one will be picked in the end). Which is obviously a waste (and gets buggy because of unintentional calls into _new_sensor). Replace the dictionary with a elif ladder. This is probably a bit more characters, but worth the performance improvement.