mirror of
https://github.com/tiqi-group/pydase.git
synced 2025-06-08 14:30:41 +02:00
Merge pull request #106 from tiqi-group/fix/enum_sio_callback
fixes sio callback when attribute changes to an enum which was not present before
This commit is contained in:
commit
698db4881b
@ -62,7 +62,7 @@ class RunMethodDict(TypedDict):
|
|||||||
kwargs: dict[str, Any]
|
kwargs: dict[str, Any]
|
||||||
|
|
||||||
|
|
||||||
def setup_sio_server(
|
def setup_sio_server( # noqa: C901
|
||||||
observer: DataServiceObserver,
|
observer: DataServiceObserver,
|
||||||
enable_cors: bool,
|
enable_cors: bool,
|
||||||
loop: asyncio.AbstractEventLoop,
|
loop: asyncio.AbstractEventLoop,
|
||||||
@ -103,6 +103,10 @@ def setup_sio_server(
|
|||||||
|
|
||||||
cached_value_dict["value"] = serialized_value["value"]
|
cached_value_dict["value"] = serialized_value["value"]
|
||||||
|
|
||||||
|
# Check if the serialized value contains an "enum" key, and if so, copy it
|
||||||
|
if "enum" in serialized_value:
|
||||||
|
cached_value_dict["enum"] = serialized_value["enum"]
|
||||||
|
|
||||||
async def notify() -> None:
|
async def notify() -> None:
|
||||||
try:
|
try:
|
||||||
await sio.emit(
|
await sio.emit(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user