python-dali 0.15__tar.gz → 0.16__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {python_dali-0.15/python_dali.egg-info → python_dali-0.16}/PKG-INFO +1 -1
- {python_dali-0.15 → python_dali-0.16}/dali/driver/serial.py +13 -5
- {python_dali-0.15 → python_dali-0.16}/dali/tests/test_serial_driver.py +19 -0
- {python_dali-0.15 → python_dali-0.16/python_dali.egg-info}/PKG-INFO +1 -1
- {python_dali-0.15 → python_dali-0.16}/setup.cfg +1 -1
- {python_dali-0.15 → python_dali-0.16}/COPYING +0 -0
- {python_dali-0.15 → python_dali-0.16}/COPYING.LESSER +0 -0
- {python_dali-0.15 → python_dali-0.16}/LICENSE +0 -0
- {python_dali-0.15 → python_dali-0.16}/README.rst +0 -0
- {python_dali-0.15 → python_dali-0.16}/dali/__init__.py +0 -0
- {python_dali-0.15 → python_dali-0.16}/dali/address.py +0 -0
- {python_dali-0.15 → python_dali-0.16}/dali/command.py +0 -0
- {python_dali-0.15 → python_dali-0.16}/dali/device/__init__.py +0 -0
- {python_dali-0.15 → python_dali-0.16}/dali/device/general.py +0 -0
- {python_dali-0.15 → python_dali-0.16}/dali/device/general_sensor.py +0 -0
- {python_dali-0.15 → python_dali-0.16}/dali/device/helpers.py +0 -0
- {python_dali-0.15 → python_dali-0.16}/dali/device/light.py +0 -0
- {python_dali-0.15 → python_dali-0.16}/dali/device/occupancy.py +0 -0
- {python_dali-0.15 → python_dali-0.16}/dali/device/pushbutton.py +0 -0
- {python_dali-0.15 → python_dali-0.16}/dali/device/sequences.py +0 -0
- {python_dali-0.15 → python_dali-0.16}/dali/driver/__init__.py +0 -0
- {python_dali-0.15 → python_dali-0.16}/dali/driver/atxled.py +0 -0
- {python_dali-0.15 → python_dali-0.16}/dali/driver/base.py +0 -0
- {python_dali-0.15 → python_dali-0.16}/dali/driver/daliserver.py +0 -0
- {python_dali-0.15 → python_dali-0.16}/dali/driver/hasseb.py +0 -0
- {python_dali-0.15 → python_dali-0.16}/dali/driver/hid.py +0 -0
- {python_dali-0.15 → python_dali-0.16}/dali/driver/trace_logging.py +0 -0
- {python_dali-0.15 → python_dali-0.16}/dali/driver/tridonic.py +0 -0
- {python_dali-0.15 → python_dali-0.16}/dali/driver/unipi.py +0 -0
- {python_dali-0.15 → python_dali-0.16}/dali/driver/usb.py +0 -0
- {python_dali-0.15 → python_dali-0.16}/dali/exceptions.py +0 -0
- {python_dali-0.15 → python_dali-0.16}/dali/frame.py +0 -0
- {python_dali-0.15 → python_dali-0.16}/dali/gear/__init__.py +0 -0
- {python_dali-0.15 → python_dali-0.16}/dali/gear/colour.py +0 -0
- {python_dali-0.15 → python_dali-0.16}/dali/gear/converter.py +0 -0
- {python_dali-0.15 → python_dali-0.16}/dali/gear/emergency.py +0 -0
- {python_dali-0.15 → python_dali-0.16}/dali/gear/general.py +0 -0
- {python_dali-0.15 → python_dali-0.16}/dali/gear/incandescent.py +0 -0
- {python_dali-0.15 → python_dali-0.16}/dali/gear/led.py +0 -0
- {python_dali-0.15 → python_dali-0.16}/dali/gear/sequences.py +0 -0
- {python_dali-0.15 → python_dali-0.16}/dali/memory/__init__.py +0 -0
- {python_dali-0.15 → python_dali-0.16}/dali/memory/diagnostics.py +0 -0
- {python_dali-0.15 → python_dali-0.16}/dali/memory/emergency.py +0 -0
- {python_dali-0.15 → python_dali-0.16}/dali/memory/energy.py +0 -0
- {python_dali-0.15 → python_dali-0.16}/dali/memory/info.py +0 -0
- {python_dali-0.15 → python_dali-0.16}/dali/memory/location.py +0 -0
- {python_dali-0.15 → python_dali-0.16}/dali/memory/maintenance.py +0 -0
- {python_dali-0.15 → python_dali-0.16}/dali/memory/oem.py +0 -0
- {python_dali-0.15 → python_dali-0.16}/dali/sequences.py +0 -0
- {python_dali-0.15 → python_dali-0.16}/dali/tests/__init__.py +0 -0
- {python_dali-0.15 → python_dali-0.16}/dali/tests/fakes.py +0 -0
- {python_dali-0.15 → python_dali-0.16}/dali/tests/fakes_serial.py +0 -0
- {python_dali-0.15 → python_dali-0.16}/dali/tests/test_colour.py +0 -0
- {python_dali-0.15 → python_dali-0.16}/dali/tests/test_command.py +0 -0
- {python_dali-0.15 → python_dali-0.16}/dali/tests/test_device_sequences.py +0 -0
- {python_dali-0.15 → python_dali-0.16}/dali/tests/test_dummy.py +0 -0
- {python_dali-0.15 → python_dali-0.16}/dali/tests/test_emergency.py +0 -0
- {python_dali-0.15 → python_dali-0.16}/dali/tests/test_events.py +0 -0
- {python_dali-0.15 → python_dali-0.16}/dali/tests/test_exceptions.py +0 -0
- {python_dali-0.15 → python_dali-0.16}/dali/tests/test_fakes.py +0 -0
- {python_dali-0.15 → python_dali-0.16}/dali/tests/test_frame.py +0 -0
- {python_dali-0.15 → python_dali-0.16}/dali/tests/test_general_sensor.py +0 -0
- {python_dali-0.15 → python_dali-0.16}/dali/tests/test_memory.py +0 -0
- {python_dali-0.15 → python_dali-0.16}/dali/tests/test_sequences.py +0 -0
- {python_dali-0.15 → python_dali-0.16}/pyproject.toml +0 -0
- {python_dali-0.15 → python_dali-0.16}/python_dali.egg-info/SOURCES.txt +0 -0
- {python_dali-0.15 → python_dali-0.16}/python_dali.egg-info/dependency_links.txt +0 -0
- {python_dali-0.15 → python_dali-0.16}/python_dali.egg-info/requires.txt +0 -0
- {python_dali-0.15 → python_dali-0.16}/python_dali.egg-info/top_level.txt +0 -0
- {python_dali-0.15 → python_dali-0.16}/setup.py +0 -0
|
@@ -1329,7 +1329,13 @@ class DriverLubaRs232(DriverSerialBase):
|
|
|
1329
1329
|
self._transport: Optional[serialx.SerialTransport] = None
|
|
1330
1330
|
self._protocol: Optional[DriverLubaRs232.LubaProtocol] = None
|
|
1331
1331
|
|
|
1332
|
-
async def connect(
|
|
1332
|
+
async def connect(
|
|
1333
|
+
self, *, scan_dev_inst: bool = False, apply_settings: bool = True
|
|
1334
|
+
) -> None:
|
|
1335
|
+
# ``apply_settings=False`` connects without writing the device settings,
|
|
1336
|
+
# leaving the interface's hardware configuration (including its bus-power
|
|
1337
|
+
# state) untouched. Use it to probe a discovered interface read-only so
|
|
1338
|
+
# the probe cannot depower a bus the integrated supply is already driving.
|
|
1333
1339
|
if self.is_connected:
|
|
1334
1340
|
_LOG.warning(
|
|
1335
1341
|
f"'connect()' called but luba232 driver already connected"
|
|
@@ -1358,8 +1364,9 @@ class DriverLubaRs232(DriverSerialBase):
|
|
|
1358
1364
|
for attempt in range(1, DriverLubaRs232.handshake_attempts + 1):
|
|
1359
1365
|
try:
|
|
1360
1366
|
await self._protocol.send_device_info_query()
|
|
1361
|
-
|
|
1362
|
-
|
|
1367
|
+
if apply_settings:
|
|
1368
|
+
self._protocol.bus_power = self.bus_power
|
|
1369
|
+
await self._protocol.send_device_settings()
|
|
1363
1370
|
break
|
|
1364
1371
|
except (asyncio.TimeoutError, TimeoutError):
|
|
1365
1372
|
if attempt >= DriverLubaRs232.handshake_attempts:
|
|
@@ -1378,8 +1385,9 @@ class DriverLubaRs232(DriverSerialBase):
|
|
|
1378
1385
|
|
|
1379
1386
|
# After switching on the integrated power supply the bus voltage takes
|
|
1380
1387
|
# a moment to rise; sending DALI frames before then fails, so wait for
|
|
1381
|
-
# the bus to be powered before scanning.
|
|
1382
|
-
|
|
1388
|
+
# the bus to be powered before scanning. Skipped when the settings were
|
|
1389
|
+
# not applied, as the bus-power state was then left untouched.
|
|
1390
|
+
if apply_settings and self.bus_power:
|
|
1383
1391
|
await self._wait_for_bus_power()
|
|
1384
1392
|
|
|
1385
1393
|
# Scan the bus for control devices, and create a mapping of addresses
|
|
@@ -94,6 +94,25 @@ async def test_connect_retries_handshake_on_timeout(monkeypatch):
|
|
|
94
94
|
assert protocol.reset_luba_response.call_count == 2
|
|
95
95
|
|
|
96
96
|
|
|
97
|
+
@pytest.mark.asyncio
|
|
98
|
+
async def test_connect_without_applying_settings_leaves_hardware_untouched(
|
|
99
|
+
monkeypatch,
|
|
100
|
+
):
|
|
101
|
+
"""connect(apply_settings=False) must not write the device settings.
|
|
102
|
+
|
|
103
|
+
A read-only probe of a discovered interface must not overwrite the
|
|
104
|
+
hardware configuration, otherwise it could depower a bus the integrated
|
|
105
|
+
supply is already driving.
|
|
106
|
+
"""
|
|
107
|
+
driver, protocol = _connecting_driver(monkeypatch, [None])
|
|
108
|
+
|
|
109
|
+
await driver.connect(apply_settings=False)
|
|
110
|
+
|
|
111
|
+
assert driver.is_connected
|
|
112
|
+
assert protocol.send_device_info_query.await_count == 1
|
|
113
|
+
assert protocol.send_device_settings.await_count == 0
|
|
114
|
+
|
|
115
|
+
|
|
97
116
|
@pytest.mark.asyncio
|
|
98
117
|
async def test_connect_raises_after_exhausting_handshake_attempts(monkeypatch):
|
|
99
118
|
"""When every handshake attempt times out, connect must give up and raise."""
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|