|
11 | 11 |
|
12 | 12 | def prepare_bus(dali: DaliInterface) -> None: |
13 | 13 | # INITIALISE ALL |
14 | | - write_gear_frame_and_wait(dali, GearSpecialCommandOpcode.INITIALISE, 0, True) |
| 14 | + write_gear_frame_and_wait(dali, GearSpecialCommandOpcode.INITIALISE, 0xFF, True) |
15 | 15 |
|
16 | 16 |
|
17 | 17 | def clear_short_addresses(dali: DaliInterface) -> None: |
18 | 18 | set_gear_dtr0(dali, 0xFF) |
19 | 19 | address = GearAddress() |
| 20 | + address.broadcast() |
20 | 21 | write_gear_frame_and_wait(dali, address.byte, GearConfigureCommandOpcode.SET_SHORT_ADDRESS, True) |
21 | 22 |
|
22 | 23 |
|
23 | 24 | def remove_from_all_groups(dali: DaliInterface) -> None: |
24 | 25 | for group in range(DaliMax.GEAR_GROUP): |
25 | 26 | address = GearAddress() |
| 27 | + address.broadcast() |
26 | 28 | write_gear_frame_and_wait(dali, address.byte, GearConfigureCommandOpcode.REMOVE_GROUP + group, True) |
27 | 29 |
|
28 | 30 |
|
@@ -64,7 +66,7 @@ def set_short_address(dali: DaliInterface, new_short_address: int) -> bool: |
64 | 66 | GearSpecialCommandOpcode.PROGRAM_SHORT_ADDRESS, |
65 | 67 | ((new_short_address << 1) | 1), |
66 | 68 | ) |
67 | | - data = (GearSpecialCommandOpcode.VERIFY_SHORT_ADDRESS << 8) + (((new_short_address << 1) | 1) & 0xFF) |
| 69 | + data = (GearSpecialCommandOpcode.VERIFY_SHORT_ADDRESS << 8) | ((new_short_address << 1) | 1) |
68 | 70 | result = dali.query_reply(DaliFrame(length=DaliFrameLength.GEAR, data=data)) |
69 | 71 | if result.length == DaliFrameLength.BACKWARD: |
70 | 72 | write_gear_frame(dali, GearSpecialCommandOpcode.WITHDRAW) |
|
0 commit comments