nuki_hub icon indicating copy to clipboard operation
nuki_hub copied to clipboard

Extend keypad

Open iranl opened this issue 1 year ago • 1 comments

Todo

  • [x] Publish all keypad code info to keypad/json
  • [x] Allow changing all keypad code info through keypad/actionJson
  • [x] Update README

Closes #280

Adds all available keypad functions from the API to Nuki Hub.

All available information from keypad codes (except codes themselves) is published to keypad/json

Example:

[
  {
    "codeId": 1234,
    "enabled": 1,
    "name": "Test",
    "dateCreated": "2024-01-01 10:00:00",
    "lockCount": 100,
    "dateLastActive": "2024-04-12 10:00:00",
    "timeLimited": 0,
    "allowedFrom": "0000-00-00 00:00:00",
    "allowedUntil": "0000-00-00 00:00:00",
    "allowedWeekdays": [
      "mon",
      "tue",
      "wed",
      "thu",
      "fri",
      "sat",
      "sun"
    ],
    "allowedFromTime": "00:00",
    "allowedUntilTime": "00:00"
  }
]

Adds the ability to change all keypad codes settings by publishing to keypad/actionJson. Result is published to keypad/commandResultJson.

Examples:

Publish the following to the MQTT topic keypad/actionJson

Delete: { "action": "delete", "codeId": "1234" }

Add:

{
  "action": "add",
  "code": "589472",
  "name": "Test",
  "timeLimited": "1",
  "allowedFrom": "2024-04-12 10:00:00",
  "allowedUntil": "2034-04-12 10:00:00",
  "allowedWeekdays": [
    "wed", "thu", "fri"
  ],
  "allowedFromTime": "08:00",
  "allowedUntilTime": "16:00"
}

Update:

{
  "action": "update",
  "codeId": "1234",
  "code": "589472",
  "enabled": "1",
  "name": "Test",
  "timeLimited": "1",
  "allowedFrom": "2024-04-12 10:00:00",
  "allowedUntil": "2034-04-12 10:00:00",
  "allowedWeekdays": [
    "mon", "tue", "sat", "sun"
  ],
  "allowedFromTime": "08:00",
  "allowedUntilTime": "16:00"
}

iranl avatar Apr 12 '24 14:04 iranl

Binary for testing is available at https://github.com/technyon/nuki_hub/actions/runs/8663398058/artifacts/1408920473

iranl avatar Apr 12 '24 14:04 iranl