Skip to content

Commit a637ae4

Browse files
authored
Merge pull request #9 from gselzer/deserialize-device-subclasses
feat: Deserialize device subclasses
2 parents abf715b + 572ad24 commit a637ae4

2 files changed

Lines changed: 2 additions & 6 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ classifiers = [
3333
"Programming Language :: Python :: 3.13",
3434
"Typing :: Typed",
3535
]
36-
dependencies = ["Pyro5", "pymmcore-plus[cli]", "msgpack", "msgpack-numpy"]
36+
dependencies = ["Pyro5", "pymmcore-plus[cli]>=0.14.0", "msgpack", "msgpack-numpy"]
3737

3838
# https://peps.python.org/pep-0621/#dependencies-optional-dependencies
3939
[dependency-groups]

src/pymmcore_remote/_serialize.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -159,10 +159,6 @@ def to_dict(self, obj: Device) -> dict:
159159

160160
return {
161161
"device_label": obj.label,
162-
"adapter_name": obj._adapter_name,
163-
"device_name": obj._device_name,
164-
"type": obj._type,
165-
"description": obj._description,
166162
"core_uri": GLOBAL_DAEMON and GLOBAL_DAEMON.uriFor(CORE_NAME),
167163
}
168164

@@ -171,7 +167,7 @@ def from_dict(self, classname: str, d: dict) -> Device:
171167

172168
core_uri = d.pop("core_uri")
173169
core = MMCorePlusProxy.instance(core_uri)
174-
return Device(**d, mmcore=core)
170+
return Device.create(d["device_label"], mmcore=core)
175171

176172

177173
class SerRePattern(Serializer[re.Pattern]):

0 commit comments

Comments
 (0)