Skip to content

Commit

Permalink
Fixed few warnings related to Adaptive Lightning
Browse files Browse the repository at this point in the history
  • Loading branch information
Shaquu committed Jun 23, 2024
1 parent 271d027 commit 6536c43
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 11 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres
to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.7.0]
## [1.7.0-dev.7] - To be announced

### Fixed

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "node-red-contrib-homekit-bridged",
"version": "1.7.0-dev.6",
"version": "1.7.0-dev.7",
"description": "Node-RED nodes to simulate Apple HomeKit devices.",
"main": "build/nodes/nrchkb.js",
"scripts": {
Expand Down
14 changes: 7 additions & 7 deletions src/lib/utils/ServiceUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -263,20 +263,20 @@ module.exports = function (node: HAPServiceNodeType) {

Object.keys(msg.payload).map((key: string) => {
if (node.supported.indexOf(key) < 0) {
if (key === 'AdaptiveLightingController') {
if (key === 'AdaptiveLightingController' && node.adaptiveLightingController) {
const value = msg.payload?.[key]
const event = value?.event

if (event === 'disable') {
node.adaptiveLightingController?.disableAdaptiveLighting()
}
} else {
log.error(
`Instead of '${key}' try one of these characteristics: '${node.supported.join(
"', '"
)}'`
)
}

log.error(
`Instead of '${key}' try one of these characteristics: '${node.supported.join(
"', '"
)}'`
)
} else {
const value = msg.payload?.[key]

Expand Down
7 changes: 7 additions & 0 deletions src/lib/utils/ServiceUtils2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,13 @@ module.exports = function (node: HAPService2NodeType) {
} else {
log.error(`Callback ${callbackID} timeout`)
}
} else if (key === 'AdaptiveLightingController' && node.adaptiveLightingController) {
const value = msg.payload?.[key]
const event = value?.event

if (event === 'disable') {
node.adaptiveLightingController?.disableAdaptiveLighting()
}
} else {
log.error(
`Instead of '${key}' try one of these characteristics: '${node.supported.join(
Expand Down

0 comments on commit 6536c43

Please sign in to comment.