penguin/homekey-go

homekey-go

commit 81cc4065af04f709760b63279f3296fd1ccdfe9e

author斟酌 鵬兄 <tgckpg@gmail.com>
date2026-10-05T06:50:24Z
subjectAcknowledge removal of the placeholder returned by GET
commit 81cc4065af04f709760b63279f3296fd1ccdfe9e
Author: 斟酌 鵬兄 <tgckpg@gmail.com>
Date:   2026-10-05T06:50:24Z

    Acknowledge removal of the placeholder returned by GET
---
 Dockerfile                    | 2 +-
 build.env                     | 2 +-
 ha-app/CHANGELOG.md           | 3 +++
 ha-app/NFC.md                 | 6 +++---
 ha-app/config.yaml            | 2 +-
 internal/provision/control.go | 4 ++++
 6 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/Dockerfile b/Dockerfile
index 72d66ec..704afa5 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -10,7 +10,7 @@ RUN CGO_ENABLED=0 go build -mod=readonly -buildvcs=false -trimpath \
     -ldflags='-s -w' -o /out/homekey ./cmd/homekey
 
 FROM debian:bookworm-slim
-ARG BUILD_VERSION=0.0.4
+ARG BUILD_VERSION
 ARG BUILD_ARCH=amd64
 LABEL io.hass.type="app" \
       io.hass.version="${BUILD_VERSION}" \
diff --git a/build.env b/build.env
index d3cd6ca..4c09e9b 100644
--- a/build.env
+++ b/build.env
@@ -1,4 +1,4 @@
 IMAGE_NAME=ghcr.io/tgckpg/homekey-go
-IMAGE_TAG=0.0.4
+IMAGE_TAG=0.0.5
 
 APT_PROXY=
diff --git a/ha-app/CHANGELOG.md b/ha-app/CHANGELOG.md
index 568095b..dd97e7d 100644
--- a/ha-app/CHANGELOG.md
+++ b/ha-app/CHANGELOG.md
@@ -1,3 +1,6 @@
+## 0.0.5
+Acknowledge removal of the placeholder returned by GET
+
 ## 0.0.4
 DEBUG added logs
 
diff --git a/ha-app/NFC.md b/ha-app/NFC.md
index 4c5f868..8dfbc20 100644
--- a/ha-app/NFC.md
+++ b/ha-app/NFC.md
@@ -20,9 +20,9 @@ physical actuator integration in this release.
    existing initialization order. NFC runs in its own task with an 8192-byte
    stack; there is no need to edit an existing sdkconfig's main-task stack.
 
-2. Build and publish your usual `homekey-go` image tagged `0.0.4`, then stage
-   the HA app metadata using the existing repository workflow. Update the
-   installed app and restart it. Keep its existing persistent `/data/state`.
+2. Build and publish your usual `homekey-go`, then stage the HA app metadata
+   using the existing repository workflow. Update the installed app and restart
+   it. Keep its existing persistent `/data/state`.
 
 3. Keep the current app configuration:
 
diff --git a/ha-app/config.yaml b/ha-app/config.yaml
index 5dbce2e..6092ba0 100644
--- a/ha-app/config.yaml
+++ b/ha-app/config.yaml
@@ -1,5 +1,5 @@
 name: Home Key Go
-version: "0.0.4"
+version: "0.0.5"
 slug: homekey_go
 description: HomeKit virtual lock with Apple Home Key NFC authentication
 url: https://sgit.k8s.astropenguin.net/penguin/homekey-go/
diff --git a/internal/provision/control.go b/internal/provision/control.go
index 21e0db7..e50ac94 100644
--- a/internal/provision/control.go
+++ b/internal/provision/control.go
@@ -111,6 +111,10 @@ func readerOperation(c *Credentials, op byte, f Fields) ([]byte, error) {
 			return nil, fmt.Errorf("invalid reader key identifier")
 		}
 		if c.ReaderPrivateKey == "" {
+			// Acknowledge removal of the placeholder returned by GET
+			if hex.EncodeToString(f[4]) == keyID(make([]byte, 32)) {
+				return status(Success)
+			}
 			return status(DoesNotExist)
 		}
 		key, _ := hex.DecodeString(c.ReaderPrivateKey)