feat: prompt on duplicate device instead of silently blocking/merging approve
Single-device approve now guards duplicates per-design the same way bulk approve does, and asks the user instead of failing or silently merging: - create_node and approve_device reject a same-design duplicate (ieee, ip or mac) with 409 + the existing node; a force flag creates it anyway. - Frontend shows a confirm dialog: go to existing node, add duplicate anyway, or cancel. - approve_device no longer rejects a device already on another canvas (status is global, canvas membership is per-design) — it can be placed on a new design, matching bulk approve. - IEEE (Zigbee/Z-Wave) devices now use the same prompt as ip/mac instead of auto-merging into the existing node. - bulk approve reports which devices it skipped as duplicates. Closes #260 ha-relevant: maybe
This commit is contained in:
@@ -39,6 +39,10 @@ class NodeBase(BaseModel):
|
||||
|
||||
class NodeCreate(NodeBase):
|
||||
design_id: str | None = None
|
||||
# When a node with the same ip/mac already exists on the target design, the
|
||||
# create/approve endpoints reject with 409 so the UI can ask the user. Set
|
||||
# force=True to bypass that guard and create the duplicate deliberately.
|
||||
force: bool = False
|
||||
|
||||
|
||||
class NodeUpdate(BaseModel):
|
||||
|
||||
Reference in New Issue
Block a user