{
    "name": "Lock Codes",
    "status": "live",
    "attributes": {
        "codeChanged": {
            "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                    "value": {
                        "title": "String",
                        "type": "string",
                        "maxLength": 255
                    },
                    "data": {
                        "type": "object",
                        "additionalProperties": false,
                        "properties": {
                            "codeName": {
                                "type": "string"
                            }
                        }
                    }
                }
            },
            "actedOnBy": [
                "updateCodes",
                "deleteCode",
                "setCode"
            ]
        },
        "codeReport": {
            "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                    "value": {
                        "title": "PositiveInteger",
                        "type": "integer",
                        "minimum": 0
                    }
                },
                "required": [
                    "value"
                ]
            }
        },
        "lockCodes": {
            "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                    "value": {
                        "type": "string"
                    }
                }
            },
            "actedOnBy": [
                "updateCodes",
                "deleteCode",
                "setCode"
            ]
        },
        "scanCodes": {
            "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                    "value": {
                        "title": "String",
                        "type": "string",
                        "maxLength": 255
                    }
                }
            }
        },
        "codeLength": {
            "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                    "value": {
                        "title": "PositiveInteger",
                        "type": "integer",
                        "minimum": 0
                    }
                }
            },
            "setter": "setCodeLength"
        },
        "maxCodes": {
            "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                    "value": {
                        "title": "PositiveInteger",
                        "type": "integer",
                        "minimum": 0
                    }
                }
            }
        },
        "maxCodeLength": {
            "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                    "value": {
                        "title": "PositiveInteger",
                        "type": "integer",
                        "minimum": 0
                    }
                }
            }
        },
        "minCodeLength": {
            "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                    "value": {
                        "title": "PositiveInteger",
                        "type": "integer",
                        "minimum": 0
                    }
                }
            }
        },
        "lock": {
            "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                    "value": {
                        "title": "LockState",
                        "type": "string",
                        "enum": [
                            "locked",
                            "unknown",
                            "unlocked",
                            "unlocked with timeout",
                            "not fully locked",
                            "unlatched"
                        ]
                    },
                    "data": {
                        "type": "object",
                        "additionalProperties": false,
                        "properties": {
                            "method": {
                                "type": "string",
                                "enum": [
                                    "manual",
                                    "keypad",
                                    "auto",
                                    "command",
                                    "rfid",
                                    "fingerprint",
                                    "bluetooth"
                                ]
                            },
                            "codeId": {
                                "type": "string"
                            },
                            "codeName": {
                                "type": "string"
                            },
                            "timeout": {
                                "title": "Iso8601Date",
                                "type": "string",
                                "pattern": "^(?:[1-9]\\d{3}-?(?:(?:0[1-9]|1[0-2])-?(?:0[1-9]|1\\d|2[0-8])|(?:0[13-9]|1[0-2])-?(?:29|30)|(?:0[13578]|1[02])-?31)|(?:[1-9]\\d(?:0[48]|[2468][048]|[13579][26])|(?:[2468][048]|[13579][26])00)-?02-?29)T(?:[01]\\d|2[0-3]):?[0-5]\\d:?[0-5]\\d(?:\\.\\d{3})?(?:Z|[+-][01]\\d(?::?[0-5]\\d)?)$"
                            }
                        }
                    }
                },
                "required": [
                    "value"
                ]
            },
            "enumCommands": [
                {
                    "command": "lock",
                    "value": "locked"
                },
                {
                    "command": "unlock",
                    "value": "unlocked"
                },
                {
                    "command": "unlockWithTimeout",
                    "value": "unlocked with timeout"
                }
            ]
        },
        "migrated": {
            "schema": {
                "type": "object",
                "properties": {
                    "value": {
                        "type": "boolean"
                    }
                },
                "additionalProperties": false,
                "required": [
                    "value"
                ]
            }
        }
    },
    "commands": {
        "updateCodes": {
            "arguments": [
                {
                    "name": "codes",
                    "schema": {
                        "title": "JsonObject",
                        "type": "object"
                    },
                    "optional": false
                }
            ],
            "name": "updateCodes"
        },
        "deleteCode": {
            "arguments": [
                {
                    "name": "codeSlot",
                    "schema": {
                        "title": "PositiveInteger",
                        "type": "integer",
                        "minimum": 0
                    },
                    "optional": false
                }
            ],
            "name": "deleteCode"
        },
        "lock": {
            "arguments": [
                
            ],
            "name": "lock"
        },
        "reloadAllCodes": {
            "arguments": [
                
            ],
            "name": "reloadAllCodes"
        },
        "requestCode": {
            "arguments": [
                {
                    "name": "codeSlot",
                    "schema": {
                        "title": "PositiveInteger",
                        "type": "integer",
                        "minimum": 0
                    },
                    "optional": false
                }
            ],
            "name": "requestCode"
        },
        "setCode": {
            "arguments": [
                {
                    "name": "codeSlot",
                    "schema": {
                        "title": "PositiveInteger",
                        "type": "integer",
                        "minimum": 0
                    },
                    "optional": false
                },
                {
                    "name": "codePIN",
                    "schema": {
                        "title": "String",
                        "type": "string",
                        "maxLength": 255
                    },
                    "optional": false
                },
                {
                    "name": "codeName",
                    "schema": {
                        "title": "String",
                        "type": "string",
                        "maxLength": 255
                    },
                    "optional": false
                }
            ],
            "name": "setCode"
        },
        "unlock": {
            "arguments": [
                
            ],
            "name": "unlock"
        },
        "unlockWithTimeout": {
            "arguments": [
                
            ],
            "name": "unlockWithTimeout"
        },
        "setCodeLength": {
            "arguments": [
                {
                    "name": "length",
                    "schema": {
                        "title": "PositiveInteger",
                        "type": "integer",
                        "minimum": 0
                    },
                    "optional": false
                }
            ],
            "name": "setCodeLength"
        },
        "nameSlot": {
            "arguments": [
                {
                    "name": "codeSlot",
                    "schema": {
                        "title": "PositiveInteger",
                        "type": "integer",
                        "minimum": 0
                    },
                    "optional": false
                },
                {
                    "name": "codeName",
                    "schema": {
                        "title": "String",
                        "type": "string",
                        "maxLength": 255
                    },
                    "optional": false
                }
            ],
            "name": "nameSlot"
        },
        "migrate": {
            "arguments": [
                
            ],
            "name": "migrate"
        }
    },
    "id": "lockCodes",
    "version": 1
}