mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-09-13 07:03:16 +08:00
Fixes for add by IP
This commit is contained in:
parent
0263a9a9f5
commit
ac177659e5
@ -1,12 +1,15 @@
|
|||||||
# Copyright (c) 2019 Ultimaker B.V.
|
# Copyright (c) 2019 Ultimaker B.V.
|
||||||
# Cura is released under the terms of the LGPLv3 or higher.
|
# Cura is released under the terms of the LGPLv3 or higher.
|
||||||
|
from typing import Dict, Any
|
||||||
|
|
||||||
from ..BaseModel import BaseModel
|
from ..BaseModel import BaseModel
|
||||||
|
|
||||||
|
|
||||||
## Class representing the system status of a printer.
|
## Class representing the system status of a printer.
|
||||||
class PrinterSystemStatus(BaseModel):
|
class PrinterSystemStatus(BaseModel):
|
||||||
|
|
||||||
def __init__(self, guid: str, firmware: str, hostname: str, name: str, platform: str, variant: str, **kwargs
|
def __init__(self, guid: str, firmware: str, hostname: str, name: str, platform: str, variant: str,
|
||||||
|
hardware: Dict[str, Any], **kwargs
|
||||||
) -> None:
|
) -> None:
|
||||||
self.guid = guid
|
self.guid = guid
|
||||||
self.firmware = firmware
|
self.firmware = firmware
|
||||||
@ -14,4 +17,5 @@ class PrinterSystemStatus(BaseModel):
|
|||||||
self.name = name
|
self.name = name
|
||||||
self.platform = platform
|
self.platform = platform
|
||||||
self.variant = variant
|
self.variant = variant
|
||||||
|
self.hardware = hardware
|
||||||
super().__init__(**kwargs)
|
super().__init__(**kwargs)
|
||||||
|
@ -115,9 +115,10 @@ class LocalClusterOutputDeviceManager:
|
|||||||
self._onDeviceDiscovered("manual:{}".format(address), address, {
|
self._onDeviceDiscovered("manual:{}".format(address), address, {
|
||||||
b"name": status.name.encode("utf-8"),
|
b"name": status.name.encode("utf-8"),
|
||||||
b"address": address.encode("utf-8"),
|
b"address": address.encode("utf-8"),
|
||||||
|
b"machine": str(status.hardware.get("typeid", "")).encode("utf-8"),
|
||||||
b"manual": b"true",
|
b"manual": b"true",
|
||||||
b"incomplete": b"true",
|
b"firmware_version": status.firmware.encode("utf-8"),
|
||||||
b"temporary": b"true"
|
b"cluster_size": b"1"
|
||||||
})
|
})
|
||||||
CuraApplication.getInstance().callLater(callback, True, address)
|
CuraApplication.getInstance().callLater(callback, True, address)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user