iobroker.govee-local 0.5.0 → 0.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +9 -10
- package/build/main.js +22 -6
- package/build/main.js.map +2 -2
- package/io-package.json +28 -28
- package/package.json +4 -4
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2025-2026 Børge Grunicke <
|
|
3
|
+
Copyright (c) 2025-2026 Børge Grunicke <apps@grunicke.com>
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
package/README.md
CHANGED
|
@@ -24,6 +24,14 @@ For **Windows** Users: Please go to the settings and make sure you choose the co
|
|
|
24
24
|
Placeholder for the next version (at the beginning of the line):
|
|
25
25
|
### **WORK IN PROGRESS**
|
|
26
26
|
-->
|
|
27
|
+
### 0.5.2 (2026-11-05)
|
|
28
|
+
- update dependencies: `node-forge` (1.4.3) and `follow-redirects` (1.16.2) to fix security vulnerabilities
|
|
29
|
+
|
|
30
|
+
### 0.5.1 (2026-11-04)
|
|
31
|
+
- update dependencies: `@iobroker/testing` (6.3.0)
|
|
32
|
+
- fix states briefly jumping back to the old value after a command, until the device confirms it (#327)
|
|
33
|
+
- acknowledge commanded states once the device confirms them, even if the value did not change
|
|
34
|
+
|
|
27
35
|
### 0.5.0 (2026-09-11)
|
|
28
36
|
|
|
29
37
|
- add HomeKit-compatible hue and saturation states, and a mired color temperature state
|
|
@@ -48,22 +56,13 @@ For **Windows** Users: Please go to the settings and make sure you choose the co
|
|
|
48
56
|
- update dependencies: @types/node (25.5.0), eslint (10.1.0), @alcalzone/release-script (5.1.1), admin (7.6.20)
|
|
49
57
|
- update dependencies: @alcalzone/release-script (5.2.0), @alcalzone/release-script-plugin-iobroker (5.2.0), @alcalzone/release-script-plugin-license (5.2.0), @alcalzone/release-script-plugin-manual-review (5.2.0), @iobroker/eslint-config (2.3.4), @types/node (25.6.2), eslint (10.3.0), prettier (3.8.3), typescript (6.0.3)
|
|
50
58
|
|
|
51
|
-
### 0.4.5 (2025-11-16)
|
|
52
|
-
|
|
53
|
-
- fix scan mode inconsistency
|
|
54
|
-
enhance log output behavior
|
|
55
|
-
|
|
56
|
-
### 0.4.4 (2025-11-13)
|
|
57
|
-
|
|
58
|
-
- add option to run auto discovery once on startup, in interval or completly disable it
|
|
59
|
-
|
|
60
59
|
Older entries are available in [CHANGELOG_OLD.md](CHANGELOG_OLD.md).
|
|
61
60
|
|
|
62
61
|
## License
|
|
63
62
|
|
|
64
63
|
MIT License
|
|
65
64
|
|
|
66
|
-
Copyright (c) 2025-2026 Børge Grunicke
|
|
65
|
+
Copyright (c) 2025-2026 Børge Grunicke <apps@grunicke.com>
|
|
67
66
|
|
|
68
67
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
69
68
|
of this software and associated documentation files (the "Software"), to deal
|
package/build/main.js
CHANGED
|
@@ -43,6 +43,11 @@ class GoveeLocal extends utils.Adapter {
|
|
|
43
43
|
* the device's own brightness command.
|
|
44
44
|
*/
|
|
45
45
|
static FULL_COLOR_VALUE = 100;
|
|
46
|
+
/**
|
|
47
|
+
* How long a user command (ack = false) is protected against being overwritten by a differing
|
|
48
|
+
* device status. Such a status was most likely requested before the command was applied.
|
|
49
|
+
*/
|
|
50
|
+
static COMMAND_CONFIRMATION_TIMEOUT_MS = 2e3;
|
|
46
51
|
/** Instance of GoveeService for device communication */
|
|
47
52
|
goveeService;
|
|
48
53
|
/**
|
|
@@ -195,7 +200,11 @@ class GoveeLocal extends utils.Adapter {
|
|
|
195
200
|
}
|
|
196
201
|
}
|
|
197
202
|
/**
|
|
198
|
-
* Updates a state only if
|
|
203
|
+
* Updates a state only if its value or acknowledgement has changed.
|
|
204
|
+
* Comparing the ack flag as well ensures a user command (ack = false) gets acknowledged
|
|
205
|
+
* once the device confirms it, even though the value itself stays the same.
|
|
206
|
+
* A recent user command is not overwritten by a differing value, so a stale device status
|
|
207
|
+
* cannot make the state jump back before the device has applied the command.
|
|
199
208
|
*
|
|
200
209
|
* @param fullName Full object path
|
|
201
210
|
* @param state New value
|
|
@@ -203,12 +212,19 @@ class GoveeLocal extends utils.Adapter {
|
|
|
203
212
|
*/
|
|
204
213
|
async updateStateAsync(fullName, state, acknowledged = true) {
|
|
205
214
|
const currentState = await this.getStateAsync(fullName);
|
|
206
|
-
if (
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
215
|
+
if (currentState) {
|
|
216
|
+
if (currentState.val === state && currentState.ack === acknowledged) {
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
219
|
+
const awaitingConfirmation = !currentState.ack && Date.now() - currentState.ts < GoveeLocal.COMMAND_CONFIRMATION_TIMEOUT_MS;
|
|
220
|
+
if (awaitingConfirmation && currentState.val !== state) {
|
|
221
|
+
return;
|
|
222
|
+
}
|
|
211
223
|
}
|
|
224
|
+
await this.setState(fullName, {
|
|
225
|
+
val: state,
|
|
226
|
+
ack: acknowledged
|
|
227
|
+
});
|
|
212
228
|
}
|
|
213
229
|
/**
|
|
214
230
|
* Handles device discovery event from GoveeService.
|
package/build/main.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/main.ts"],
|
|
4
|
-
"sourcesContent": ["/*\n * Created with @iobroker/create-adapter v2.3.0\n */\n\nimport * as utils from '@iobroker/adapter-core';\nimport { GoveeService, type DeviceDiscoveryEvent, type DeviceStatusEvent } from './lib/goveeService';\nimport { hsvToRgb, kelvinToMired, rgbToHsv } from './lib/tools/colorConversion';\nimport { componentToHex, hexToRgb } from './lib/tools/hexTool';\n\n/**\n * Main adapter class for ioBroker Govee Local.\n * Handles initialization, event wiring, and communication with GoveeService.\n */\nexport class GoveeLocal extends utils.Adapter {\n /**\n * Value (the V in HSV) used when converting a hue/saturation change back to RGB.\n * Kept at 100 so the color is always sent at full scale and the peak RGB channel\n * stays 255 regardless of saturation; overall output is controlled separately via\n * the device's own brightness command.\n */\n private static readonly FULL_COLOR_VALUE = 100;\n /** Instance of GoveeService for device communication */\n private goveeService!: GoveeService;\n /**\n * Adapter constructor. Registers lifecycle event handlers.\n *\n * @param options Optional adapter options to override defaults.\n */\n public constructor(options: Partial<utils.AdapterOptions> = {}) {\n super({\n ...options,\n name: 'govee-local',\n });\n // Register event handlers for adapter lifecycle\n this.on('ready', this.onReady.bind(this));\n this.on('stateChange', this.onStateChange.bind(this));\n // Uncomment if you want to handle object changes or messages:\n // this.on('objectChange', this.onObjectChange.bind(this));\n // this.on('message', this.onMessage.bind(this));\n this.on('unload', this.onUnload.bind(this));\n }\n\n /**\n * Called when databases are connected and adapter received configuration.\n * Initializes GoveeService and sets up event listeners for device events.\n */\n private onReady(): void {\n // Create connection indicator state if it doesn't exist\n void this.setObjectNotExists('info.connection', {\n type: 'state',\n common: {\n name: 'Device discovery running',\n type: 'boolean',\n role: 'indicator.connected',\n read: true,\n write: false,\n },\n native: {},\n });\n\n // Create state for discovered devices\n void this.setObjectNotExists('info.discoveredDevices', {\n type: 'state',\n common: {\n name: 'List of discovered devices',\n type: 'string',\n role: 'json',\n read: true,\n write: false,\n desc: 'JSON object with IP addresses and device names of all discovered devices',\n },\n native: {},\n });\n\n // Initialize GoveeService with adapter config and logger\n this.goveeService = new GoveeService({\n interface: this.config.interface,\n searchInterval: this.config.searchInterval,\n deviceStatusRefreshInterval: this.config.deviceStatusRefreshInterval,\n extendedLogging: this.config.extendedLogging,\n forbiddenChars: this.FORBIDDEN_CHARS,\n manualIpAddresses: this.config.manualIpTable,\n scanMode: this.config.scanMode,\n setInterval: (callback: () => void, ms: number) => this.setInterval(callback, ms),\n clearInterval: (timeout: unknown) => this.clearInterval(timeout as ioBroker.Interval | undefined),\n logger: {\n debug: msg => this.log.debug(msg),\n info: msg => this.log.info(msg),\n error: msg => this.log.error(msg),\n },\n });\n\n // Listen for device discovery and status update events\n this.goveeService.on('deviceDiscovered', data => {\n this.handleDeviceDiscovered(data).catch((err: unknown) => {\n this.log.error(`Error handling device discovery: ${err instanceof Error ? err.message : String(err)}`);\n });\n });\n\n this.goveeService.on('deviceStatusUpdate', data => {\n this.handleDeviceStatusUpdate(data).catch((err: unknown) => {\n this.log.error(\n `Error handling device status update: ${err instanceof Error ? err.message : String(err)}`,\n );\n });\n });\n\n // Listen for serviceStarted event to set connection state to true\n this.goveeService.on('serviceStarted', () => {\n void this.setState('info.connection', { val: true, ack: true });\n });\n\n // Start device discovery and status polling\n this.goveeService.start();\n\n if (this.config.extendedLogging) {\n this.log.debug('running with extended logging');\n }\n\n // Subscribe to all device status state changes\n this.subscribeStates('*.devStatus.*');\n }\n\n /**\n * Called if a subscribed state changes (e.g. user toggles a switch in ioBroker UI).\n * Forwards the change to the GoveeService for device communication.\n *\n * @param id The ID of the changed state.\n * @param state The new state object or null/undefined.\n */\n private async onStateChange(id: string, state: ioBroker.State | null | undefined): Promise<void> {\n if (state && !state.ack) {\n const deviceName = id.split('.')[2];\n const stateKey = id.split('.')[4];\n // Extract device name from state ID and get its IP address\n const ipOfDevice = await this.getStateAsync(`${deviceName}.deviceInfo.ip`);\n const receiver = ipOfDevice?.val?.toString();\n if (typeof receiver === 'string') {\n if (stateKey === 'hue' || stateKey === 'saturation') {\n await this.handleHueSaturationChange(deviceName, stateKey, state, receiver);\n } else {\n // Forward the state change to the GoveeService\n this.goveeService.handleStateChange(id, state, receiver);\n }\n } else {\n this.log.error('device not found or IP is not a string');\n }\n }\n }\n\n /**\n * Handles a hue or saturation change by combining it with the sibling state and\n * sending the resulting color as an RGB command. The HSV value is fixed at full scale;\n * overall brightness is controlled separately via the brightness state.\n *\n * @param deviceName The sanitized device name.\n * @param changedKey Which of the two states triggered the change.\n * @param state The new state value.\n * @param receiver The device IP address.\n */\n private async handleHueSaturationChange(\n deviceName: string,\n changedKey: 'hue' | 'saturation',\n state: ioBroker.State,\n receiver: string,\n ): Promise<void> {\n const otherKey = changedKey === 'hue' ? 'saturation' : 'hue';\n const otherState = await this.getStateAsync(`${deviceName}.devStatus.${otherKey}`);\n const hue = Number(changedKey === 'hue' ? state.val : (otherState?.val ?? 0));\n const saturation = Number(changedKey === 'saturation' ? state.val : (otherState?.val ?? 0));\n\n if (!Number.isFinite(hue) || !Number.isFinite(saturation)) {\n this.log.error(`Ignoring ${changedKey} change for ${deviceName}: hue/saturation is not a number`);\n return;\n }\n\n const { r, g, b } = hsvToRgb(hue, saturation, GoveeLocal.FULL_COLOR_VALUE);\n this.goveeService.sendColorCommand(receiver, `#${componentToHex(r)}${componentToHex(g)}${componentToHex(b)}`);\n }\n\n /**\n * Called when the adapter shuts down. Cleans up resources and stops services.\n *\n * @param callback Callback function after unload process.\n */\n private onUnload(callback: () => void): void {\n try {\n if (this.goveeService) {\n this.goveeService.removeAllListeners();\n this.goveeService.stop();\n }\n // Set connection state to false\n void this.updateStateAsync('info.connection', false).catch((err: unknown) => {\n this.log.error(\n `Failed to update connection state during unload: ${err instanceof Error ? err.message : String(err)}`,\n );\n });\n callback();\n } catch (e: unknown) {\n this.log.error(e instanceof Error ? e.message : String(e));\n callback();\n }\n }\n\n /**\n * Updates a state only if the value has changed.\n *\n * @param fullName Full object path\n * @param state New value\n * @param acknowledged Whether the value is acknowledged (default: true)\n */\n private async updateStateAsync(fullName: string, state: any, acknowledged = true): Promise<void> {\n const currentState = await this.getStateAsync(fullName);\n if (currentState?.val !== state) {\n void this.setState(fullName, {\n val: state,\n ack: acknowledged,\n });\n }\n }\n\n /**\n * Handles device discovery event from GoveeService.\n * Creates all necessary objects and states for the new device.\n *\n * @param event The device discovery event data.\n */\n private async handleDeviceDiscovered(event: DeviceDiscoveryEvent): Promise<void> {\n const { ip, deviceName, deviceModel } = event;\n\n // Create device folder\n await this.setObjectNotExistsAsync(deviceName, {\n type: 'device',\n common: {\n name: deviceModel,\n role: 'group',\n },\n native: {},\n });\n\n // Create deviceInfo folder\n await this.setObjectNotExistsAsync(`${deviceName}.deviceInfo`, {\n type: 'folder',\n common: {\n name: 'Device Info',\n },\n native: {},\n });\n\n // Create IP address state\n await this.setObjectNotExistsAsync(`${deviceName}.deviceInfo.ip`, {\n type: 'state',\n common: {\n name: 'IP address of the Lamp',\n type: 'string',\n role: 'info.ip',\n read: true,\n write: false,\n },\n native: {},\n });\n await this.updateStateAsync(`${deviceName}.deviceInfo.ip`, ip);\n\n // Create devStatus folder\n await this.setObjectNotExistsAsync(`${deviceName}.devStatus`, {\n type: 'folder',\n common: {\n name: 'Device Status',\n },\n native: {},\n });\n\n // Update the list of discovered devices\n await this.updateDiscoveredDevicesList();\n }\n\n /**\n * Updates the info.discoveredDevices state with the current list of all discovered devices.\n */\n private async updateDiscoveredDevicesList(): Promise<void> {\n const devices = this.goveeService.getDevices();\n await this.setState('info.discoveredDevices', {\n val: JSON.stringify(devices, null, 2),\n ack: true,\n });\n }\n\n /**\n * Handles device status update event from GoveeService.\n * Creates and updates all relevant states for the device.\n *\n * @param event The device status update event data.\n */\n private async handleDeviceStatusUpdate(event: DeviceStatusEvent): Promise<void> {\n const { deviceName, status } = event;\n\n // Create and update onOff state\n await this.setObjectNotExistsAsync(`${deviceName}.devStatus.onOff`, {\n type: 'state',\n common: {\n name: 'On / Off state of the lamp',\n type: 'boolean',\n role: 'switch',\n read: true,\n write: true,\n },\n native: {},\n });\n await this.updateStateAsync(`${deviceName}.devStatus.onOff`, status.onOff);\n\n // Create and update brightness state\n await this.setObjectNotExistsAsync(`${deviceName}.devStatus.brightness`, {\n type: 'state',\n common: {\n name: 'Brightness of the light',\n type: 'number',\n role: 'level.dimmer',\n read: true,\n write: true,\n },\n native: {},\n });\n await this.updateStateAsync(`${deviceName}.devStatus.brightness`, status.brightness);\n\n // Create and update color state\n await this.setObjectNotExistsAsync(`${deviceName}.devStatus.color`, {\n type: 'state',\n common: {\n name: 'Current showing color of the lamp',\n type: 'string',\n role: 'level.color.rgb',\n read: true,\n write: true,\n },\n native: {},\n });\n await this.updateStateAsync(`${deviceName}.devStatus.color`, status.color);\n\n // Create and update hue state (HomeKit compatible)\n await this.setObjectNotExistsAsync(`${deviceName}.devStatus.hue`, {\n type: 'state',\n common: {\n name: 'Hue of the lamp (HomeKit compatible)',\n type: 'number',\n role: 'level.color.hue',\n unit: '\u00B0',\n min: 0,\n max: 360,\n read: true,\n write: true,\n },\n native: {},\n });\n\n // Create and update saturation state (HomeKit compatible)\n await this.setObjectNotExistsAsync(`${deviceName}.devStatus.saturation`, {\n type: 'state',\n common: {\n name: 'Saturation of the lamp (HomeKit compatible)',\n type: 'number',\n role: 'level.color.saturation',\n unit: '%',\n min: 0,\n max: 100,\n read: true,\n write: true,\n },\n native: {},\n });\n\n const { hue, saturation } = rgbToHsv(hexToRgb(status.color));\n await this.updateStateAsync(`${deviceName}.devStatus.hue`, hue);\n await this.updateStateAsync(`${deviceName}.devStatus.saturation`, saturation);\n\n // Create and update color temperature state\n await this.setObjectNotExistsAsync(`${deviceName}.devStatus.colorTemInKelvin`, {\n type: 'state',\n common: {\n name: 'If staying in white light, the color temperature',\n type: 'number',\n role: 'level.color.temperature',\n read: true,\n write: true,\n },\n native: {},\n });\n await this.updateStateAsync(`${deviceName}.devStatus.colorTemInKelvin`, status.colorTemInKelvin);\n\n // Create and update color temperature in mired (HomeKit compatible)\n await this.setObjectNotExistsAsync(`${deviceName}.devStatus.colorTemperature`, {\n type: 'state',\n common: {\n name: 'Color temperature of the lamp in mired (HomeKit compatible)',\n type: 'number',\n role: 'level.color.temperature',\n unit: 'mired',\n read: true,\n write: true,\n },\n native: {},\n });\n // Govee devices report colorTemInKelvin as 0 while in RGB color mode; a mired value\n // is only meaningful while the lamp is actually in white/temperature mode.\n if (status.colorTemInKelvin > 0) {\n await this.updateStateAsync(\n `${deviceName}.devStatus.colorTemperature`,\n kelvinToMired(status.colorTemInKelvin),\n );\n }\n }\n}\n\n// Export factory function for ioBroker or start instance directly\nif (require.main !== module) {\n // Export factory function for ioBroker. GoveeLocal is attached to the same function\n // object so it stays available as a named export (`import { GoveeLocal } from './main'`)\n // for tests, instead of being lost when module.exports is replaced.\n module.exports = Object.assign((options: Partial<utils.AdapterOptions> | undefined) => new GoveeLocal(options), {\n GoveeLocal,\n });\n} else {\n // Otherwise start the instance directly\n (() => new GoveeLocal())();\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,YAAuB;AACvB,0BAAgF;AAChF,6BAAkD;AAClD,qBAAyC;AAMlC,MAAM,mBAAmB,MAAM,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAO1C,OAAwB,mBAAmB;AAAA;AAAA,
|
|
4
|
+
"sourcesContent": ["/*\n * Created with @iobroker/create-adapter v2.3.0\n */\n\nimport * as utils from '@iobroker/adapter-core';\nimport { GoveeService, type DeviceDiscoveryEvent, type DeviceStatusEvent } from './lib/goveeService';\nimport { hsvToRgb, kelvinToMired, rgbToHsv } from './lib/tools/colorConversion';\nimport { componentToHex, hexToRgb } from './lib/tools/hexTool';\n\n/**\n * Main adapter class for ioBroker Govee Local.\n * Handles initialization, event wiring, and communication with GoveeService.\n */\nexport class GoveeLocal extends utils.Adapter {\n /**\n * Value (the V in HSV) used when converting a hue/saturation change back to RGB.\n * Kept at 100 so the color is always sent at full scale and the peak RGB channel\n * stays 255 regardless of saturation; overall output is controlled separately via\n * the device's own brightness command.\n */\n private static readonly FULL_COLOR_VALUE = 100;\n /**\n * How long a user command (ack = false) is protected against being overwritten by a differing\n * device status. Such a status was most likely requested before the command was applied.\n */\n private static readonly COMMAND_CONFIRMATION_TIMEOUT_MS = 2000;\n /** Instance of GoveeService for device communication */\n private goveeService!: GoveeService;\n /**\n * Adapter constructor. Registers lifecycle event handlers.\n *\n * @param options Optional adapter options to override defaults.\n */\n public constructor(options: Partial<utils.AdapterOptions> = {}) {\n super({\n ...options,\n name: 'govee-local',\n });\n // Register event handlers for adapter lifecycle\n this.on('ready', this.onReady.bind(this));\n this.on('stateChange', this.onStateChange.bind(this));\n // Uncomment if you want to handle object changes or messages:\n // this.on('objectChange', this.onObjectChange.bind(this));\n // this.on('message', this.onMessage.bind(this));\n this.on('unload', this.onUnload.bind(this));\n }\n\n /**\n * Called when databases are connected and adapter received configuration.\n * Initializes GoveeService and sets up event listeners for device events.\n */\n private onReady(): void {\n // Create connection indicator state if it doesn't exist\n void this.setObjectNotExists('info.connection', {\n type: 'state',\n common: {\n name: 'Device discovery running',\n type: 'boolean',\n role: 'indicator.connected',\n read: true,\n write: false,\n },\n native: {},\n });\n\n // Create state for discovered devices\n void this.setObjectNotExists('info.discoveredDevices', {\n type: 'state',\n common: {\n name: 'List of discovered devices',\n type: 'string',\n role: 'json',\n read: true,\n write: false,\n desc: 'JSON object with IP addresses and device names of all discovered devices',\n },\n native: {},\n });\n\n // Initialize GoveeService with adapter config and logger\n this.goveeService = new GoveeService({\n interface: this.config.interface,\n searchInterval: this.config.searchInterval,\n deviceStatusRefreshInterval: this.config.deviceStatusRefreshInterval,\n extendedLogging: this.config.extendedLogging,\n forbiddenChars: this.FORBIDDEN_CHARS,\n manualIpAddresses: this.config.manualIpTable,\n scanMode: this.config.scanMode,\n setInterval: (callback: () => void, ms: number) => this.setInterval(callback, ms),\n clearInterval: (timeout: unknown) => this.clearInterval(timeout as ioBroker.Interval | undefined),\n logger: {\n debug: msg => this.log.debug(msg),\n info: msg => this.log.info(msg),\n error: msg => this.log.error(msg),\n },\n });\n\n // Listen for device discovery and status update events\n this.goveeService.on('deviceDiscovered', data => {\n this.handleDeviceDiscovered(data).catch((err: unknown) => {\n this.log.error(`Error handling device discovery: ${err instanceof Error ? err.message : String(err)}`);\n });\n });\n\n this.goveeService.on('deviceStatusUpdate', data => {\n this.handleDeviceStatusUpdate(data).catch((err: unknown) => {\n this.log.error(\n `Error handling device status update: ${err instanceof Error ? err.message : String(err)}`,\n );\n });\n });\n\n // Listen for serviceStarted event to set connection state to true\n this.goveeService.on('serviceStarted', () => {\n void this.setState('info.connection', { val: true, ack: true });\n });\n\n // Start device discovery and status polling\n this.goveeService.start();\n\n if (this.config.extendedLogging) {\n this.log.debug('running with extended logging');\n }\n\n // Subscribe to all device status state changes\n this.subscribeStates('*.devStatus.*');\n }\n\n /**\n * Called if a subscribed state changes (e.g. user toggles a switch in ioBroker UI).\n * Forwards the change to the GoveeService for device communication.\n *\n * @param id The ID of the changed state.\n * @param state The new state object or null/undefined.\n */\n private async onStateChange(id: string, state: ioBroker.State | null | undefined): Promise<void> {\n if (state && !state.ack) {\n const deviceName = id.split('.')[2];\n const stateKey = id.split('.')[4];\n // Extract device name from state ID and get its IP address\n const ipOfDevice = await this.getStateAsync(`${deviceName}.deviceInfo.ip`);\n const receiver = ipOfDevice?.val?.toString();\n if (typeof receiver === 'string') {\n if (stateKey === 'hue' || stateKey === 'saturation') {\n await this.handleHueSaturationChange(deviceName, stateKey, state, receiver);\n } else {\n // Forward the state change to the GoveeService\n this.goveeService.handleStateChange(id, state, receiver);\n }\n } else {\n this.log.error('device not found or IP is not a string');\n }\n }\n }\n\n /**\n * Handles a hue or saturation change by combining it with the sibling state and\n * sending the resulting color as an RGB command. The HSV value is fixed at full scale;\n * overall brightness is controlled separately via the brightness state.\n *\n * @param deviceName The sanitized device name.\n * @param changedKey Which of the two states triggered the change.\n * @param state The new state value.\n * @param receiver The device IP address.\n */\n private async handleHueSaturationChange(\n deviceName: string,\n changedKey: 'hue' | 'saturation',\n state: ioBroker.State,\n receiver: string,\n ): Promise<void> {\n const otherKey = changedKey === 'hue' ? 'saturation' : 'hue';\n const otherState = await this.getStateAsync(`${deviceName}.devStatus.${otherKey}`);\n const hue = Number(changedKey === 'hue' ? state.val : (otherState?.val ?? 0));\n const saturation = Number(changedKey === 'saturation' ? state.val : (otherState?.val ?? 0));\n\n if (!Number.isFinite(hue) || !Number.isFinite(saturation)) {\n this.log.error(`Ignoring ${changedKey} change for ${deviceName}: hue/saturation is not a number`);\n return;\n }\n\n const { r, g, b } = hsvToRgb(hue, saturation, GoveeLocal.FULL_COLOR_VALUE);\n this.goveeService.sendColorCommand(receiver, `#${componentToHex(r)}${componentToHex(g)}${componentToHex(b)}`);\n }\n\n /**\n * Called when the adapter shuts down. Cleans up resources and stops services.\n *\n * @param callback Callback function after unload process.\n */\n private onUnload(callback: () => void): void {\n try {\n if (this.goveeService) {\n this.goveeService.removeAllListeners();\n this.goveeService.stop();\n }\n // Set connection state to false\n void this.updateStateAsync('info.connection', false).catch((err: unknown) => {\n this.log.error(\n `Failed to update connection state during unload: ${err instanceof Error ? err.message : String(err)}`,\n );\n });\n callback();\n } catch (e: unknown) {\n this.log.error(e instanceof Error ? e.message : String(e));\n callback();\n }\n }\n\n /**\n * Updates a state only if its value or acknowledgement has changed.\n * Comparing the ack flag as well ensures a user command (ack = false) gets acknowledged\n * once the device confirms it, even though the value itself stays the same.\n * A recent user command is not overwritten by a differing value, so a stale device status\n * cannot make the state jump back before the device has applied the command.\n *\n * @param fullName Full object path\n * @param state New value\n * @param acknowledged Whether the value is acknowledged (default: true)\n */\n private async updateStateAsync(fullName: string, state: any, acknowledged = true): Promise<void> {\n const currentState = await this.getStateAsync(fullName);\n if (currentState) {\n if (currentState.val === state && currentState.ack === acknowledged) {\n return;\n }\n const awaitingConfirmation =\n !currentState.ack && Date.now() - currentState.ts < GoveeLocal.COMMAND_CONFIRMATION_TIMEOUT_MS;\n if (awaitingConfirmation && currentState.val !== state) {\n return;\n }\n }\n await this.setState(fullName, {\n val: state,\n ack: acknowledged,\n });\n }\n\n /**\n * Handles device discovery event from GoveeService.\n * Creates all necessary objects and states for the new device.\n *\n * @param event The device discovery event data.\n */\n private async handleDeviceDiscovered(event: DeviceDiscoveryEvent): Promise<void> {\n const { ip, deviceName, deviceModel } = event;\n\n // Create device folder\n await this.setObjectNotExistsAsync(deviceName, {\n type: 'device',\n common: {\n name: deviceModel,\n role: 'group',\n },\n native: {},\n });\n\n // Create deviceInfo folder\n await this.setObjectNotExistsAsync(`${deviceName}.deviceInfo`, {\n type: 'folder',\n common: {\n name: 'Device Info',\n },\n native: {},\n });\n\n // Create IP address state\n await this.setObjectNotExistsAsync(`${deviceName}.deviceInfo.ip`, {\n type: 'state',\n common: {\n name: 'IP address of the Lamp',\n type: 'string',\n role: 'info.ip',\n read: true,\n write: false,\n },\n native: {},\n });\n await this.updateStateAsync(`${deviceName}.deviceInfo.ip`, ip);\n\n // Create devStatus folder\n await this.setObjectNotExistsAsync(`${deviceName}.devStatus`, {\n type: 'folder',\n common: {\n name: 'Device Status',\n },\n native: {},\n });\n\n // Update the list of discovered devices\n await this.updateDiscoveredDevicesList();\n }\n\n /**\n * Updates the info.discoveredDevices state with the current list of all discovered devices.\n */\n private async updateDiscoveredDevicesList(): Promise<void> {\n const devices = this.goveeService.getDevices();\n await this.setState('info.discoveredDevices', {\n val: JSON.stringify(devices, null, 2),\n ack: true,\n });\n }\n\n /**\n * Handles device status update event from GoveeService.\n * Creates and updates all relevant states for the device.\n *\n * @param event The device status update event data.\n */\n private async handleDeviceStatusUpdate(event: DeviceStatusEvent): Promise<void> {\n const { deviceName, status } = event;\n\n // Create and update onOff state\n await this.setObjectNotExistsAsync(`${deviceName}.devStatus.onOff`, {\n type: 'state',\n common: {\n name: 'On / Off state of the lamp',\n type: 'boolean',\n role: 'switch',\n read: true,\n write: true,\n },\n native: {},\n });\n await this.updateStateAsync(`${deviceName}.devStatus.onOff`, status.onOff);\n\n // Create and update brightness state\n await this.setObjectNotExistsAsync(`${deviceName}.devStatus.brightness`, {\n type: 'state',\n common: {\n name: 'Brightness of the light',\n type: 'number',\n role: 'level.dimmer',\n read: true,\n write: true,\n },\n native: {},\n });\n await this.updateStateAsync(`${deviceName}.devStatus.brightness`, status.brightness);\n\n // Create and update color state\n await this.setObjectNotExistsAsync(`${deviceName}.devStatus.color`, {\n type: 'state',\n common: {\n name: 'Current showing color of the lamp',\n type: 'string',\n role: 'level.color.rgb',\n read: true,\n write: true,\n },\n native: {},\n });\n await this.updateStateAsync(`${deviceName}.devStatus.color`, status.color);\n\n // Create and update hue state (HomeKit compatible)\n await this.setObjectNotExistsAsync(`${deviceName}.devStatus.hue`, {\n type: 'state',\n common: {\n name: 'Hue of the lamp (HomeKit compatible)',\n type: 'number',\n role: 'level.color.hue',\n unit: '\u00B0',\n min: 0,\n max: 360,\n read: true,\n write: true,\n },\n native: {},\n });\n\n // Create and update saturation state (HomeKit compatible)\n await this.setObjectNotExistsAsync(`${deviceName}.devStatus.saturation`, {\n type: 'state',\n common: {\n name: 'Saturation of the lamp (HomeKit compatible)',\n type: 'number',\n role: 'level.color.saturation',\n unit: '%',\n min: 0,\n max: 100,\n read: true,\n write: true,\n },\n native: {},\n });\n\n const { hue, saturation } = rgbToHsv(hexToRgb(status.color));\n await this.updateStateAsync(`${deviceName}.devStatus.hue`, hue);\n await this.updateStateAsync(`${deviceName}.devStatus.saturation`, saturation);\n\n // Create and update color temperature state\n await this.setObjectNotExistsAsync(`${deviceName}.devStatus.colorTemInKelvin`, {\n type: 'state',\n common: {\n name: 'If staying in white light, the color temperature',\n type: 'number',\n role: 'level.color.temperature',\n read: true,\n write: true,\n },\n native: {},\n });\n await this.updateStateAsync(`${deviceName}.devStatus.colorTemInKelvin`, status.colorTemInKelvin);\n\n // Create and update color temperature in mired (HomeKit compatible)\n await this.setObjectNotExistsAsync(`${deviceName}.devStatus.colorTemperature`, {\n type: 'state',\n common: {\n name: 'Color temperature of the lamp in mired (HomeKit compatible)',\n type: 'number',\n role: 'level.color.temperature',\n unit: 'mired',\n read: true,\n write: true,\n },\n native: {},\n });\n // Govee devices report colorTemInKelvin as 0 while in RGB color mode; a mired value\n // is only meaningful while the lamp is actually in white/temperature mode.\n if (status.colorTemInKelvin > 0) {\n await this.updateStateAsync(\n `${deviceName}.devStatus.colorTemperature`,\n kelvinToMired(status.colorTemInKelvin),\n );\n }\n }\n}\n\n// Export factory function for ioBroker or start instance directly\nif (require.main !== module) {\n // Export factory function for ioBroker. GoveeLocal is attached to the same function\n // object so it stays available as a named export (`import { GoveeLocal } from './main'`)\n // for tests, instead of being lost when module.exports is replaced.\n module.exports = Object.assign((options: Partial<utils.AdapterOptions> | undefined) => new GoveeLocal(options), {\n GoveeLocal,\n });\n} else {\n // Otherwise start the instance directly\n (() => new GoveeLocal())();\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,YAAuB;AACvB,0BAAgF;AAChF,6BAAkD;AAClD,qBAAyC;AAMlC,MAAM,mBAAmB,MAAM,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAO1C,OAAwB,mBAAmB;AAAA;AAAA;AAAA;AAAA;AAAA,EAK3C,OAAwB,kCAAkC;AAAA;AAAA,EAElD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMD,YAAY,UAAyC,CAAC,GAAG;AAC5D,UAAM;AAAA,MACF,GAAG;AAAA,MACH,MAAM;AAAA,IACV,CAAC;AAED,SAAK,GAAG,SAAS,KAAK,QAAQ,KAAK,IAAI,CAAC;AACxC,SAAK,GAAG,eAAe,KAAK,cAAc,KAAK,IAAI,CAAC;AAIpD,SAAK,GAAG,UAAU,KAAK,SAAS,KAAK,IAAI,CAAC;AAAA,EAC9C;AAAA;AAAA;AAAA;AAAA;AAAA,EAMQ,UAAgB;AAEpB,SAAK,KAAK,mBAAmB,mBAAmB;AAAA,MAC5C,MAAM;AAAA,MACN,QAAQ;AAAA,QACJ,MAAM;AAAA,QACN,MAAM;AAAA,QACN,MAAM;AAAA,QACN,MAAM;AAAA,QACN,OAAO;AAAA,MACX;AAAA,MACA,QAAQ,CAAC;AAAA,IACb,CAAC;AAGD,SAAK,KAAK,mBAAmB,0BAA0B;AAAA,MACnD,MAAM;AAAA,MACN,QAAQ;AAAA,QACJ,MAAM;AAAA,QACN,MAAM;AAAA,Q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ee-local",
|
|
4
|
-
"version": "0.5.
|
|
4
|
+
"version": "0.5.2",
|
|
5
5
|
"news": {
|
|
6
|
+
"0.5.2": {
|
|
7
|
+
"en": "update dependencies: `node-forge` (1.4.3) and `follow-redirects` (1.16.2) to fix security vulnerabilities",
|
|
8
|
+
"de": "Abhängigkeiten aktualisieren: `Node-Forge` (1.4.3) und `Follow-Redirects` (1.16.2), um Sicherheitslücken zu schließen",
|
|
9
|
+
"ru": "обновите зависимости: `nodeforge` (1.4.3) и `follow-redirects` (1.16.2) для устранения уязвимостей безопасности",
|
|
10
|
+
"pt": "atualize as dependências: `node-forge` (1.4.3) e `follow-redirects` (1.16.2) para corrigir falhas",
|
|
11
|
+
"nl": "update-afhankelijkheden: `node-forge` (1.4.3) en `follow-redirects` (1.16.2) om beveiligingsproblemen te verhelpen",
|
|
12
|
+
"fr": "dépendances de mise à jour : « node-forge » (1.4.3) et « follow-redirections » (1.16.2) pour corriger les failles de sécurité",
|
|
13
|
+
"it": "aggiornare le dipendenze: `node-forge` (1.4.3) e `follow-redirects` (1.16.2) per correggere falle",
|
|
14
|
+
"es": "actualizar dependencias: `node-forge` (1.4.3) y `follow-redirects` (1.16.2) para corregir vulnerabilidades de seguridad",
|
|
15
|
+
"pl": "aktualizacja zależności: `node-forge` (1.4.3) i `follow-redirects` (1.16.2) w celu naprawienia luk w zabezpieczeniach",
|
|
16
|
+
"uk": "оновлення залежностей: `node-forge` (1.4.3) та `follow-redirects` (1.16.2) для виправлення вразливостей безпеки",
|
|
17
|
+
"zh-cn": "更新依赖关系:`node-forge` (1.4.3) 和 `follow-redirects` (1.16.2) 以修复安全漏洞"
|
|
18
|
+
},
|
|
19
|
+
"0.5.1": {
|
|
20
|
+
"en": "update dependencies: `@iobroker/testing` (6.3.0)\nfix states briefly jumping back to the old value after a command, until the device confirms it (#327)\nacknowledge commanded states once the device confirms them, even if the value did not change",
|
|
21
|
+
"de": "Updates: `@iobroker /testing` (6.3.0)\nFix: Status springen nach einem Befehl kurz auf den alten Wert zurück, bis das Gerät ihn bestätigt (#327)\nBestätigen Sie Befehle, wenn das Gerät sie bestätigt, auch wenn sich der Wert nicht ändert",
|
|
22
|
+
"ru": "обновления зависимостей: `@iobroker /testing` (6.3.0)\nисправление состояний, ненадолго возвращающихся к старому значению после выполнения команды, пока устройство не подтвердит это (#327)\nподтвердите командные состояния, как только устройство подтвердит их, даже если значение не изменилось",
|
|
23
|
+
"pt": "atualizar dependências: `@iobroker /testing` (6.3.0)\nfixa estados que retornam ao valor antigo após um comando, até que o dispositivo o confirme (#327)\nconfirme os estados de comando quando o dispositivo os confirma, mesmo que o valor não mude",
|
|
24
|
+
"nl": "afhankelijkheden voor updates: `@iobroker /testing` (6.3.0)\nstatussen corrigeren waarbij kort wordt teruggesprongen naar de oude waarde na een opdracht, totdat het apparaat de opdracht bevestigt (#327)\nerken de commandostaten zodra het apparaat ze bevestigt, zelfs als de waarde niet is gewijzigd",
|
|
25
|
+
"fr": "dépendances de mise à jour : @iobroker /testing (6.3.0)\nfix indique de revenir brièvement à l'ancienne valeur après une commande, jusqu'à confirmation (#327)\naccepter les états des commandes une fois que l'appareil les confirme, même si la valeur n'a pas changé",
|
|
26
|
+
"it": "aggiorna dipendenze: `@iobroker /test` (6.3.0)\nfix torna brevemente al vecchio valore dopo un comando, finché il dispositivo non lo conferma (#327)\nconferma gli stati comandati dal dispositivo, anche se il valore non è cambiato",
|
|
27
|
+
"es": "actualizar dependencias: `@iobroker /testing` (6.3.0)\ncorregir estados que vuelven brevemente al valor anterior tras un comando, hasta que el dispositivo lo confirme (#327)\nreconocer los estados del comando una vez que el dispositivo los confirme, aunque el valor no cambie",
|
|
28
|
+
"pl": "zależności aktualizacji: `@iobroker /testing` (6.3.0)\nstany poprawiające krótko przeskakujące z powrotem do starej wartości po poleceniu, aż urządzenie to potwierdzi (#327)\npotwierdzić polecone stany, gdy urządzenie je potwierdzi, nawet jeśli wartość nie uległa zmianie",
|
|
29
|
+
"uk": "залежності оновлення: `@iobroker /тестування` (6.3.0)\nвиправлення станів короткочасного переходу до старого значення після команди, поки пристрій не підтвердить це (#327)\nпідтвердити командні стани, коли пристрій підтвердить їх, навіть якщо значення не змінилося",
|
|
30
|
+
"zh-cn": "更新依赖关系:`@iobroker /testing` (6.3.0)\n修复在设备确认命令后短暂跳回旧值的状态 (#327)\n一旦设备确认命令状态,即使值没有改变,也要确认这些状态"
|
|
31
|
+
},
|
|
6
32
|
"0.5.0": {
|
|
7
33
|
"en": "add HomeKit-compatible hue and saturation states, and a mired color temperature state\nAdapter requires node.js >= 22.19.0 now\nupdate dependencies: `@iobroker/testing` (6.2.1)\nremoved the now obsolete npm overrides for `mocha` subdependencies `diff` and `serialize-javascript`\nupdate dependencies",
|
|
8
34
|
"de": "HomeKit-kompatiblen Farbton, Sättigung und Farbtemperatur hinzufügen\nAdapter benötigt jetzt node.js >= 22.19.0\nUpdates: `@iobroker /testing` (6.2.1)\nentfernte die veralteten NPM-Überschreibungen für Mocha, Diff und Serialize-Javascript\nAbhängigkeiten updaten",
|
|
@@ -67,32 +93,6 @@
|
|
|
67
93
|
"pl": "dodaj opcję, aby uruchomić automatyczne wykrywanie raz na starcie, w przedziale lub całkowicie go wyłączyć",
|
|
68
94
|
"uk": "додати можливість запустити автовідкриття один раз на запуску, в інтервалі або комплетувати його",
|
|
69
95
|
"zh-cn": "添加在启动、间隔或完全禁用时运行自动发现的选项"
|
|
70
|
-
},
|
|
71
|
-
"0.4.3": {
|
|
72
|
-
"en": "fix responsive design in the settings\nrevert forbidden characters checking\nupdate dependencies",
|
|
73
|
-
"de": "reagierendes design in den einstellungen beheben\nzurücksetzen verbotene zeichen überprüfen\naktualisierung der abhängigkeiten",
|
|
74
|
-
"ru": "исправить отзывчивый дизайн в настройках\nпроверка запрещенных персонажей\nобновление зависимостей",
|
|
75
|
-
"pt": "corrigir o design responsivo nas configurações\nreverter a verificação de caracteres proibidos\natualizar dependências",
|
|
76
|
-
"nl": "repareren responsief ontwerp in de instellingen\n_verboden tekens controleren\nafhankelijkheden bijwerken",
|
|
77
|
-
"fr": "fixer la conception réactive dans les paramètres\nretourner la vérification des caractères interdits\nmettre à jour les dépendances",
|
|
78
|
-
"it": "fissare il design reattivo nelle impostazioni\nrevert i caratteri vietati controllando\naggiornamento dipendenze",
|
|
79
|
-
"es": "fijar diseño sensible en la configuración\nrevertir caracteres prohibidos\ndependencias de actualización",
|
|
80
|
-
"pl": "naprawić reagujący projekt w ustawieniach\nrevert zabronione sprawdzanie znaków\naktualizacji zależności",
|
|
81
|
-
"uk": "виправити адаптивний дизайн в налаштуваннях\nперевернути заборонені символи перевірки\nоновлення залежності",
|
|
82
|
-
"zh-cn": "在设置中固定响应性设计\n返回禁用字符检查\n更新依赖关系"
|
|
83
|
-
},
|
|
84
|
-
"0.4.2": {
|
|
85
|
-
"en": "update dependencies\nfix device name / model identifier in the objects",
|
|
86
|
-
"de": "aktualisierung der abhängigkeiten\ngerätename / modellkennung in den objekten fixieren",
|
|
87
|
-
"ru": "обновление зависимостей\nфиксировать имя устройства / идентификатор модели в объектах",
|
|
88
|
-
"pt": "atualizar dependências\ncorrigir o nome do dispositivo / identificador do modelo nos objetos",
|
|
89
|
-
"nl": "afhankelijkheden bijwerken\nfix apparaatnaam / modelidentificatie in de objecten",
|
|
90
|
-
"fr": "mettre à jour les dépendances\ncorrection du nom du périphérique / de l'identificateur du modèle dans les objets",
|
|
91
|
-
"it": "aggiornamento dipendenze\nfix nome del dispositivo / modello identificatore negli oggetti",
|
|
92
|
-
"es": "dependencias de actualización\nfijar el nombre del dispositivo / identificador modelo en los objetos",
|
|
93
|
-
"pl": "aktualizacji zależności\nnaprawić nazwę urządzenia / identyfikator modelu w obiektach",
|
|
94
|
-
"uk": "оновлення залежності\nвиправити назву пристрою / ідентифікатор моделі в об'єктах",
|
|
95
|
-
"zh-cn": "更新依赖关系\n对象中的固定设备名称/ 模型标识符"
|
|
96
96
|
}
|
|
97
97
|
},
|
|
98
98
|
"titleLang": {
|
|
@@ -122,7 +122,7 @@
|
|
|
122
122
|
"uk": "Керуйте пристроями Govee через локальний доступ (без хмари)"
|
|
123
123
|
},
|
|
124
124
|
"authors": [
|
|
125
|
-
"Børge Grunicke <
|
|
125
|
+
"Børge Grunicke <apps@grunicke.com>"
|
|
126
126
|
],
|
|
127
127
|
"keywords": [
|
|
128
128
|
"govee",
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "iobroker.govee-local",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.2",
|
|
4
4
|
"description": "Control Govee devices via local access (no cloud)",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Børge Grunicke",
|
|
7
|
-
"email": "
|
|
7
|
+
"email": "apps@grunicke.com"
|
|
8
8
|
},
|
|
9
9
|
"homepage": "https://github.com/boergegrunicke/ioBroker.govee-local",
|
|
10
10
|
"license": "MIT",
|
|
@@ -31,9 +31,9 @@
|
|
|
31
31
|
"@alcalzone/release-script-plugin-manual-review": "^5.2.0",
|
|
32
32
|
"@iobroker/adapter-dev": "^1.5.0",
|
|
33
33
|
"@iobroker/eslint-config": "^2.2.0",
|
|
34
|
-
"@iobroker/testing": "^6.
|
|
34
|
+
"@iobroker/testing": "^6.3.0",
|
|
35
35
|
"@tsconfig/node22": "^22.0.6",
|
|
36
|
-
"@types/node": "^22.20.
|
|
36
|
+
"@types/node": "^22.20.4",
|
|
37
37
|
"@types/proxyquire": "^1.3.31",
|
|
38
38
|
"proxyquire": "^2.1.3",
|
|
39
39
|
"rimraf": "^6.1.2",
|