Skip to content

Commit c3a988f

Browse files
committed
Fix similarly-named but very different DeviceState enums (#22)
1 parent 42b14f9 commit c3a988f

File tree

4 files changed

+9
-4
lines changed

4 files changed

+9
-4
lines changed

tests/test_application.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ def on_endpoint_deletion(req):
249249
Status=t.Status.SUCCESS,
250250
IEEE=t.EUI64([0x00, 0x12, 0x4B, 0x00, 0x1C, 0xAA, 0xAC, 0x5C]),
251251
NWK=t.NWK(0xFFFE),
252-
DeviceType=t.DeviceLogicalType(7),
252+
DeviceType=t.DeviceTypeCapabilities(7),
253253
DeviceState=t.DeviceState.InitializedNotStarted,
254254
AssociatedDevices=[],
255255
)

zigpy_znp/commands/app_config.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ class BDBCommissioningStatus(t.enum_uint8):
4040
TLNotPermitted = 0x06
4141
TCLKExFailure = 0x07
4242
FormationFailure = 0x08
43-
Initialization = 0x00
4443
FBTargetInProgress = 0x09
4544
FBInitiatorInProgress = 0x0A
4645
FBNoIdentifyQueryResponse = 0x0B

zigpy_znp/commands/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class Util(t.CommandsBase, subsystem=t.Subsystem.UTIL):
3838
),
3939
t.Param("IEEE", t.EUI64, "Extended address of the device"),
4040
t.Param("NWK", t.NWK, "Short address of the device"),
41-
t.Param("DeviceType", t.DeviceLogicalType, "Device type"),
41+
t.Param("DeviceType", t.DeviceTypeCapabilities, "Device type"),
4242
t.Param(
4343
"DeviceState", t.DeviceState, "Indicated the state of the device"
4444
),

zigpy_znp/types/named.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,13 @@ class StartupOptions(basic.enum_flag_uint8):
281281
AutoStart = 1 << 2
282282

283283

284-
class DeviceLogicalType(basic.enum_flag_uint8):
284+
class DeviceLogicalType(basic.enum_uint8):
285+
Coordinator = 0
286+
Router = 1
287+
EndDevice = 2
288+
289+
290+
class DeviceTypeCapabilities(basic.enum_flag_uint8):
285291
Coordinator = 1 << 0
286292
Router = 1 << 1
287293
EndDevice = 1 << 2

0 commit comments

Comments
 (0)