Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DeviceInstanceMapper: do not skip devices with inputDeviceError #136

Merged
merged 1 commit into from
May 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions dali/device/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,7 @@ def autodiscover(
if isinstance(rsp, QueryDeviceStatusResponse):
# Make sure the status is OK
if (
rsp.input_device_error
or rsp.short_address_is_mask
rsp.short_address_is_mask
or rsp.reset_state
):
continue
Expand Down
6 changes: 3 additions & 3 deletions dali/tests/test_device_sequences.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class DeviceFakeError(fakes.Device):
_device_status = 0b00000001


def test_device_autodiscover_skip_bad(fakes_bus):
def test_device_autodiscover_dont_skip_bad(fakes_bus):
dev_inst_map = DeviceInstanceTypeMapper()
# Add an extra fake device, one with an error bit set
fakes_bus.gear.append(
Expand All @@ -86,8 +86,8 @@ def test_device_autodiscover_skip_bad(fakes_bus):
assert rsp.input_device_error

fakes_bus.run_sequence(dev_inst_map.autodiscover())
# The device in error mode shouldn't have had its instances counted
assert len(dev_inst_map.mapping) == 12
# The mere fact that a device has "inputDeviceError" set does not mean it is not usable
assert len(dev_inst_map.mapping) == 16


class DeviceNoInstances(fakes.Device):
Expand Down
Loading