Skip to content

Commit

Permalink
debug: additional debug info
Browse files Browse the repository at this point in the history
  • Loading branch information
philipparndt committed May 19, 2024
1 parent 5d23be5 commit 634c00f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app/lib/api/v2/hue-api-v2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,14 @@ export const stopTestPutLights = () => {

const lock = new AsyncLock({ timeout: 5000 })
export const putLight = async (light: HueIdentifiable, message: PutLight) => {

Check failure on line 111 in app/lib/api/v2/hue-api-v2.ts

View workflow job for this annotation

GitHub Actions / build

Block must not be padded by blank lines

if (message.color && message.color_temperature) {
log.warn("Both color and color_temperature set, put is likely to fail", {
light,
message
})
}

const [resolveResult, promise] = resolvable()
lock.acquire("put", async (done) => {
if (testPutLights) {
Expand Down
7 changes: 7 additions & 0 deletions app/lib/put/put-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ export const putMessage = async (resource: HueIdentifiable, message: Buffer) =>
else {
const newResource = toLight(resource, lightMsg)

if (newResource.color && newResource.color_temperature) {
log.warn("PUT Handler: Both color and color_temperature set, put is likely to fail", {
newResource,
message
})
}

// resource will be updated by the Hue SSE API
try {
await putLightResource(newResource)
Expand Down

0 comments on commit 634c00f

Please sign in to comment.