jaraco / jaraco.abode

MIT License
11 stars 9 forks source link

Incorrect param type assumed for Client.get_devices() #12

Closed tradel closed 1 year ago

tradel commented 1 year ago

The original abodepy library expected the generic_type argument to get_devices() to be a list of strings or None:

https://github.com/MisterWil/abodepy/blob/4ffce2314ed7e2c5d48a2c2758fddaef440b05ad/abodepy/__init__.py#L273-L274

                if (device.generic_type is not None and
                        device.generic_type in generic_type):

This fails in jaraco.abode because the new logic tests for equality, not membership in the list:

https://github.com/jaraco/jaraco.abode/blob/c82a82f4981d7dcd8e05b3cae665f8ed0c383328/jaraco/abode/client.py#L164

This causes the unit tests in homeassistant to fail in test_binary_sensor.py because the test passes a list of device types.

jaraco commented 1 year ago

Looks like I made this change in 885330f8, thinking it was mistakenly trying to match a substring and not a list of strings.

jaraco commented 1 year ago

The current test suite asserts 'connectivity' in 'connectivity', which is True, but also would allow get_devices(generic_type='connectivity-king') to match connectivity. I don't think that's desirable.

jaraco commented 1 year ago

Should be fixed with v3.1.1.