Skip to content

Commit d37e858

Browse files
committed
Add parent_channel_num to VueDeviceChannel
1 parent 972e338 commit d37e858

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pyemvue/device.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ def __init__(
142142
self.channel_type_gid = channelTypeGid
143143
self.nested_devices = {}
144144
self.type = ""
145+
self.parent_channel_num = ""
145146

146147
def from_json_dictionary(self, js: "dict[str, Any]") -> Self:
147148
"""Populate device channel data from a dictionary extracted from the response json."""
@@ -157,6 +158,8 @@ def from_json_dictionary(self, js: "dict[str, Any]") -> Self:
157158
self.channel_type_gid = js["channelTypeGid"]
158159
if "type" in js:
159160
self.type = js["type"]
161+
if "parentChannelNum" in js:
162+
self.parent_channel_num = js["parentChannelNum"]
160163
return self
161164

162165
# Known types: Main, FiftyAmp, FiftyAmpBidirectional
@@ -169,7 +172,8 @@ def as_dictionary(self) -> "dict[str, Any]":
169172
"channelNum": self.channel_num,
170173
"channelMultiplier": self.channel_multiplier,
171174
"channelTypeGid": self.channel_type_gid,
172-
"type": self.type
175+
"type": self.type,
176+
"parentChannelNum": self.parent_channel_num
173177
}
174178

175179

0 commit comments

Comments
 (0)