mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-06-26 09:25:24 -06:00
Review comment
- Set default to `""` for `Optional[str]` to remove the `or ""` -The FW version can be returned as None which requires the fallback `or ""`
This commit is contained in:
parent
6a230b3df5
commit
9cf75648ab
1 changed files with 19 additions and 10 deletions
|
@ -20,14 +20,23 @@ from ..BaseModel import BaseModel
|
|||
class ClusterPrinterStatus(BaseModel):
|
||||
"""Class representing a cluster printer"""
|
||||
|
||||
def __init__(self, enabled: Optional[bool] = True, friendly_name: Optional[str] = "", machine_variant: Optional[str] = "",
|
||||
status: Optional[str] = "unknown", unique_name: Optional[str] = "", uuid: Optional[str] = "",
|
||||
def __init__(self,
|
||||
enabled: Optional[bool] = True,
|
||||
friendly_name: Optional[str] = "",
|
||||
machine_variant: Optional[str] = "",
|
||||
status: Optional[str] = "unknown",
|
||||
unique_name: Optional[str] = "",
|
||||
uuid: Optional[str] = "",
|
||||
configuration: Optional[List[Union[Dict[str, Any], ClusterPrintCoreConfiguration]]] = None,
|
||||
firmware_version: Optional[str] = None, ip_address: Optional[str] = None,
|
||||
reserved_by: Optional[str] = None, maintenance_required: Optional[bool] = False,
|
||||
firmware_update_status: Optional[str] = None, latest_available_firmware: Optional[str] = None,
|
||||
firmware_version: Optional[str] = None,
|
||||
ip_address: Optional[str] = None,
|
||||
reserved_by: Optional[str] = "",
|
||||
maintenance_required: Optional[bool] = False,
|
||||
firmware_update_status: Optional[str] = "",
|
||||
latest_available_firmware: Optional[str] = "",
|
||||
build_plate: Optional[Union[Dict[str, Any], ClusterBuildPlate]] = None,
|
||||
material_station: Optional[Union[Dict[str, Any], ClusterPrinterMaterialStation]] = None, **kwargs) -> None:
|
||||
material_station: Optional[Union[Dict[str, Any], ClusterPrinterMaterialStation]] = None,
|
||||
**kwargs) -> None:
|
||||
"""
|
||||
Creates a new cluster printer status
|
||||
:param enabled: A printer can be disabled if it should not receive new jobs. By default, every printer is enabled.
|
||||
|
@ -81,10 +90,10 @@ class ClusterPrinterStatus(BaseModel):
|
|||
:param model: - The output model to update.
|
||||
"""
|
||||
|
||||
model.updateKey(self.uuid or "")
|
||||
model.updateName(self.friendly_name or "")
|
||||
model.updateUniqueName(self.unique_name or "")
|
||||
model.updateType(self.machine_variant or "")
|
||||
model.updateKey(self.uuid)
|
||||
model.updateName(self.friendly_name)
|
||||
model.updateUniqueName(self.unique_name)
|
||||
model.updateType(self.machine_variant)
|
||||
model.updateState(self.status if self.enabled else "disabled")
|
||||
model.updateBuildplate(self.build_plate.type if self.build_plate else "glass")
|
||||
if self.ip_address:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue