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

Try fix build #5

Closed
wants to merge 3 commits into from
Closed
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Fixed

- set the implied value for AbstractDeviceComponentState/ActivationState to "On"

### Added

- support for python version 3.12
Expand Down
2 changes: 1 addition & 1 deletion src/sdc11073/mdib/statecontainers.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ class AbstractDeviceComponentStateContainer(AbstractStateContainer):
PhysicalConnector = cp.SubElementProperty([domTag('PhysicalConnector')],
valueClass=pmtypes.PhysicalConnectorInfo) # optional

ActivationState = cp.NodeAttributeProperty('ActivationState') # pmtypes.ComponentActivation
ActivationState = cp.NodeAttributeProperty('ActivationState', impliedPyValue=pmtypes.ComponentActivation.ON)
OperatingHours = cp.IntegerAttributeProperty('OperatingHours') # optional, unsigned int
OperatingCycles = cp.IntegerAttributeProperty('OperatingCycles') # optional, unsigned int
_props = (
Expand Down
11 changes: 9 additions & 2 deletions tests/test_discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,10 @@ def test_multicast_listening(self):
for address in all_addresses:
unicast_sock.sendto(f'<bla>unicast{address} all </bla>'.encode('utf-8'),
(address, self.MY_MULTICAST_PORT))
time.sleep(0.5)
i = 0
while wrapped_obj.call_count < len(all_addresses) and i < 5:
i += 1
time.sleep(0.25)
self.assertGreaterEqual(wrapped_obj.call_count, len(all_addresses))

wsd_service_all.stop() # do not interfere with next instance
Expand All @@ -396,7 +399,11 @@ def test_multicast_listening(self):
for address in all_addresses:
unicast_sock.sendto(f'<bla>unicast{address} all </bla>'.encode('utf-8'),
(address, self.MY_MULTICAST_PORT))
time.sleep(0.5)

i = 0
while not wrapped_obj.call_count and i < 5:
i += 1
time.sleep(0.25)
wrapped_obj.assert_called()
finally:
unicast_sock.close()
Expand Down
2 changes: 1 addition & 1 deletion tests/test_statecontainers.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ def verifyEqual(origin, copied):
sc = statecontainers.AbstractDeviceComponentStateContainer(nsmapper=self.nsmapper,
descriptorContainer=self.dc,
node=None)
self.assertEqual(sc.ActivationState, None)
self.assertEqual(sc.ActivationState, pmtypes.ComponentActivation.ON)
self.assertEqual(sc.OperatingHours, None)
self.assertEqual(sc.OperatingCycles, None)
self.assertEqual(sc.PhysicalConnector, None)
Expand Down
Loading