maximvelichko / pyvera

A python library to control devices via the Vera hub
GNU General Public License v2.0
26 stars 30 forks source link

Fix for: https://github.com/home-assistant/home-assistant/issues/24987 #115

Closed MarkJenniskens closed 5 years ago

MarkJenniskens commented 5 years ago

because device_id is a string and the keys in _self.devices are integers...

Maybe some other code should be changed so the types match, but this fixes the issue. Now the device_list is populated (is it really a list, it's always just one device, or am I missing something? )

brandond commented 5 years ago

It seems like device IDs cannot be counted on to be encoded consistently as ints or strings across all versions of the controller firmware, or to even exist at all. It would probably be worthwhile to find all the places where device IDs are looked up or compared and ensure that we're reliably casting everything to ints or strings across the board.

MarkJenniskens commented 5 years ago

It seems like device IDs cannot be counted on to be encoded consistently as ints or strings across all versions of the controller firmware, or to even exist at all. It would probably be worthwhile to find all the places where device IDs are looked up or compared and ensure that we're reliably casting everything to ints or strings across the board.

It becomes a problem when using device_id as a key for a dict/list, then the types need to match... (as I understand)