iobroker.govee-local 0.3.1 → 0.4.0

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/README.md CHANGED
@@ -24,95 +24,102 @@ 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.4.0 (2025-11-02)
28
+
29
+ - Updated translations for datapoint descriptions in all supported languages
30
+ - Refreshed and modernized the admin UI: clearer sections, manual IP address list, Windows hint, and option to disable auto-discovery
31
+ - Possibility to manually add devices via IP-Address and Option to disable auto discovery
32
+ - Save auto discovered devices in info datapoint and show in admin UI
33
+
27
34
  ### 0.3.1 (2025-10-19)
28
35
 
29
- - updated release script run configuration
36
+ - updated release script run configuration
30
37
 
31
38
  ### 0.3.0 (2025-10-19)
32
39
 
33
- - Refactored: Moved all device logic to a dedicated GoveeService class, modularized utilities
34
- - Improved test coverage
35
- - Dependencies updated
40
+ - Refactored: Moved all device logic to a dedicated GoveeService class, modularized utilities
41
+ - Improved test coverage
42
+ - Dependencies updated
36
43
 
37
44
  ### 0.2.9 (2025-08-22)
38
45
 
39
- - update dependencies
40
- - add support for node 24
41
- - update to ESlint 9
46
+ - update dependencies
47
+ - add support for node 24
48
+ - update to ESlint 9
42
49
 
43
50
  ### 0.2.8 (2025-03-28)
44
51
 
45
- - update dependencies
46
- - avoid repeated overriding of states
52
+ - update dependencies
53
+ - avoid repeated overriding of states
47
54
 
48
55
  ### 0.2.7 (2024-08-18)
49
56
 
50
- - update core dependencies and min required node version to 18
57
+ - update core dependencies and min required node version to 18
51
58
 
52
59
  ### 0.2.6 (2024-02-06)
53
60
 
54
- - fix brightness change also changing white temperature
61
+ - fix brightness change also changing white temperature
55
62
 
56
63
  ### 0.2.5 (2024-01-13)
57
64
 
58
- - create only one socket, as the second seems not to be necessary
59
- - refactoring the code for better structure
60
- - possibility to choose listen interface in settings
65
+ - create only one socket, as the second seems not to be necessary
66
+ - refactoring the code for better structure
67
+ - possibility to choose listen interface in settings
61
68
 
62
69
  ### 0.2.4 (2024-01-05)
63
70
 
64
- - fix access
71
+ - fix access
65
72
 
66
73
  ### 0.2.2 (2024-01-05)
67
74
 
68
- - fix color temperature message
75
+ - fix color temperature message
69
76
 
70
77
  ### 0.2.1 (2023-12-24)
71
78
 
72
- - repair onOff / all other actions Fixes: [#65](https://github.com/boergegrunicke/ioBroker.govee-local/issues/65)
73
- - fix log spamming because of wildcard
79
+ - repair onOff / all other actions Fixes: [#65](https://github.com/boergegrunicke/ioBroker.govee-local/issues/65)
80
+ - fix log spamming because of wildcard
74
81
 
75
82
  ### 0.2.0 (2023-12-17)
76
83
 
77
- - support controlling the color
78
- - extended logging mode
84
+ - support controlling the color
85
+ - extended logging mode
79
86
 
80
87
  ### 0.1.2 (2023-09-06)
81
88
 
82
- - change icon path and resolution
89
+ - change icon path and resolution
83
90
 
84
91
  ### 0.1.1 (2023-08-21)
85
92
 
86
- - fix image
93
+ - fix image
87
94
 
88
95
  ### 0.1.0 (2023-08-09)
89
96
 
90
- - make search intervals configurable
91
- - clear all timeouts, when adapter is stopped
92
- - replace forbidden characters in names
93
- - update translations
94
- - update dependencies
97
+ - make search intervals configurable
98
+ - clear all timeouts, when adapter is stopped
99
+ - replace forbidden characters in names
100
+ - update translations
101
+ - update dependencies
95
102
 
96
103
  ### 0.0.6 (2023-05-18)
97
104
 
98
- - update dependencies
105
+ - update dependencies
99
106
 
100
107
  ### 0.0.5 (2023-04-02)
101
108
 
102
- - make pipeline run
109
+ - make pipeline run
103
110
 
104
111
  ### 0.0.4 (2023-04-02)
105
112
 
106
- - make device status refresh independent from device search interval
113
+ - make device status refresh independent from device search interval
107
114
 
108
115
  ### 0.0.3 (2023-04-01)
109
116
 
110
- - update dependencies
117
+ - update dependencies
111
118
 
112
119
  ### 0.0.2
113
120
 
114
- - frequently searching for devices and requesting their specific state
115
- - on / off state, brightness and and color temperature can be controlled
121
+ - frequently searching for devices and requesting their specific state
122
+ - on / off state, brightness and and color temperature can be controlled
116
123
 
117
124
  ## License
118
125
 
@@ -1,9 +1,21 @@
1
1
  {
2
- "govee-local adapter settings": "Adaptereinstellungen für govee-local",
3
- "_searchInterval": "Suchintervall",
4
- "_deviceStatusRefreshInterval": "Aktualisierungsintervall für den Gerätestatus",
5
- "_configDescription": "Hier muss nichts konfiguriert werden. Bitte die Intervalle nur ändern, wenn dies explizit gewollt ist.",
6
- "_extendedLoggingDescription": "Die erweiterte Protokollierung druckt alle vom Gerät empfangenen Daten mit Ebeneninformationen in das Protokoll. Da dies zu einem großen Log-Spam führt, wird empfohlen, die Funktion nur bei Bedarf einzuschalten und anschließend wieder auszuschalten.",
7
- "_extendedLogging": "Erweiterte Protokollierung aktiviert",
8
- "_networkInterface": "Netzwerkschnittstelle"
2
+ "govee-local adapter settings": "Adaptereinstellungen für govee-local",
3
+ "_searchInterval": "Suchintervall",
4
+ "_deviceStatusRefreshInterval": "Aktualisierungsintervall für den Gerätestatus",
5
+ "_configDescription": "Hier muss nichts konfiguriert werden. Bitte die Intervalle nur ändern, wenn dies explizit gewollt ist.",
6
+ "_extendedLoggingDescription": "Die erweiterte Protokollierung druckt alle vom Gerät empfangenen Daten mit Ebeneninformationen in das Protokoll. Da dies zu einem großen Log-Spam führt, wird empfohlen, die Funktion nur bei Bedarf einzuschalten und anschließend wieder auszuschalten.",
7
+ "_extendedLogging": "Erweiterte Protokollierung aktiviert",
8
+ "_networkInterface": "Netzwerkschnittstelle",
9
+ "_networkHint": "Windows-Nutzer: Sie müssen eventuell Ihre IP-Adresse manuell auswählen, da das Lauschen auf allen Schnittstellen unter Umständen nicht zuverlässig funktioniert.",
10
+ "_manualIpAddresses": "Manuelle IP-Adressen",
11
+ "_manualIpHint": "Hier können Sie IP-Adressen für Geräte eintragen, die nicht automatisch gefunden wurden.",
12
+ "_discoveredDevicesHint": "Alle gefundenen Geräte (automatisch und manuell) werden unten angezeigt:",
13
+ "_discoveredDevices": "Gefundene Geräte",
14
+ "_disableAutoDiscovery": "Automatische Suche deaktivieren",
15
+ "datapoint.model": "Spezifisches Modell der Lampe",
16
+ "datapoint.ip": "IP-Adresse der Lampe",
17
+ "datapoint.bleVersionHard": "Bluetooth Low Energy Hardware-Version",
18
+ "datapoint.bleVersionSoft": "Bluetooth Low Energy Software-Version",
19
+ "datapoint.wifiVersionHard": "WiFi-Hardware-Version",
20
+ "datapoint.wifiVersionSoft": "WiFi-Software-Version"
9
21
  }
@@ -5,5 +5,17 @@
5
5
  "_configDescription": "There is nothing mandatory to configure. Please change the intervals only when you are sure that this is what you need",
6
6
  "_extendedLoggingDescription": "Extended Logging prints all the data received by the device to the log with level info. As this produces a huge log spamming it is recommended to turn this on, only when needed and turnoff again afterwards.",
7
7
  "_extendedLogging": "Extended Logging enabled",
8
- "_networkInterface": "Network Interface"
8
+ "_networkInterface": "Network Interface",
9
+ "_networkHint": "Windows users: You may need to select your IP address manually, as listening on all interfaces may not work reliably.",
10
+ "_manualIpAddresses": "Manual IP Addresses",
11
+ "_manualIpHint": "You can add IP addresses here for devices that were not auto-discovered.",
12
+ "_discoveredDevicesHint": "All discovered devices (auto and manual) are shown below:",
13
+ "_discoveredDevices": "Discovered Devices",
14
+ "_disableAutoDiscovery": "Disable auto-discovery",
15
+ "datapoint.model": "Specific model of the Lamp",
16
+ "datapoint.ip": "IP address of the Lamp",
17
+ "datapoint.bleVersionHard": "Bluetooth Low Energy Hardware Version",
18
+ "datapoint.bleVersionSoft": "Bluetooth Low Energy Software Version",
19
+ "datapoint.wifiVersionHard": "WiFi Hardware Version",
20
+ "datapoint.wifiVersionSoft": "WiFi Software Version"
9
21
  }
@@ -5,5 +5,17 @@
5
5
  "_configDescription": "No hay nada obligatorio para configurar. Cambie los intervalos solo cuando esté seguro de que esto es lo que necesita",
6
6
  "_extendedLoggingDescription": "El registro extendido imprime todos los datos recibidos por el dispositivo en el registro con información de nivel. Como esto produce un enorme spam de registros, se recomienda activarlo sólo cuando sea necesario y desactivarlo nuevamente después.",
7
7
  "_extendedLogging": "Registro extendido habilitado",
8
- "_networkInterface": "Interfaz de red"
8
+ "_networkInterface": "Interfaz de red",
9
+ "datapoint.model": "Modelo específico de la Lámpara",
10
+ "datapoint.ip": "Dirección IP de la lámpara",
11
+ "datapoint.bleVersionHard": "Versión de hardware Bluetooth de bajo consumo",
12
+ "datapoint.bleVersionSoft": "Versión del software Bluetooth de bajo consumo de energía",
13
+ "datapoint.wifiVersionHard": "Versión de hardware WiFi",
14
+ "datapoint.wifiVersionSoft": "Versión del software WiFi",
15
+ "_networkHint": "Usuarios de Windows: es posible que deban seleccionar su dirección IP manualmente, ya que escuchar en todas las interfaces puede no funcionar de manera confiable.",
16
+ "_manualIpAddresses": "Direcciones IP manuales",
17
+ "_manualIpHint": "Puede agregar direcciones IP aquí para dispositivos que no fueron descubiertos automáticamente.",
18
+ "_disableAutoDiscovery": "Desactivar el descubrimiento automático",
19
+ "_discoveredDevicesHint": "Todos los dispositivos descubiertos (automáticos y manuales) se pueden encontrar en Objetos → govee-local.0 → información → dispositivos descubiertos",
20
+ "_discoveredDevices": "Dispositivos descubiertos"
9
21
  }
@@ -5,5 +5,17 @@
5
5
  "_configDescription": "Il n'y a rien d'obligatoire à configurer. Veuillez modifier les intervalles uniquement lorsque vous êtes sûr que c'est ce dont vous avez besoin",
6
6
  "_extendedLoggingDescription": "La journalisation étendue imprime toutes les données reçues par l'appareil dans le journal avec les informations de niveau. Comme cela produit un énorme spam de journaux, il est recommandé de l'activer uniquement lorsque cela est nécessaire et de le désactiver à nouveau par la suite.",
7
7
  "_extendedLogging": "Journalisation étendue activée",
8
- "_networkInterface": "Interface réseau"
8
+ "_networkInterface": "Interface réseau",
9
+ "datapoint.model": "Modèle spécifique de la Lampe",
10
+ "datapoint.ip": "Adresse IP de la lampe",
11
+ "datapoint.bleVersionHard": "Version matérielle Bluetooth basse consommation",
12
+ "datapoint.bleVersionSoft": "Version du logiciel Bluetooth basse consommation",
13
+ "datapoint.wifiVersionHard": "Version du matériel Wi-Fi",
14
+ "datapoint.wifiVersionSoft": "Version du logiciel Wi-Fi",
15
+ "_networkHint": "Utilisateurs Windows : vous devrez peut-être sélectionner votre adresse IP manuellement, car l'écoute sur toutes les interfaces peut ne pas fonctionner de manière fiable.",
16
+ "_manualIpAddresses": "Adresses IP manuelles",
17
+ "_manualIpHint": "Vous pouvez ajouter ici des adresses IP pour les appareils qui n'ont pas été découverts automatiquement.",
18
+ "_disableAutoDiscovery": "Désactiver la découverte automatique",
19
+ "_discoveredDevicesHint": "Tous les appareils découverts (auto et manuels) peuvent être trouvés dans Objets → govee-local.0 → info → discoveredDevices",
20
+ "_discoveredDevices": "Appareils découverts"
9
21
  }
@@ -5,5 +5,17 @@
5
5
  "_configDescription": "Non c'è nulla di obbligatorio da configurare. Si prega di modificare gli intervalli solo quando si è sicuri che questo è ciò di cui si ha bisogno",
6
6
  "_extendedLoggingDescription": "La registrazione estesa stampa tutti i dati ricevuti dal dispositivo nel registro con le informazioni sul livello. Poiché ciò produce un enorme spam nei registri, si consiglia di attivarlo solo quando necessario e di disattivarlo nuovamente in seguito.",
7
7
  "_extendedLogging": "Registrazione estesa abilitata",
8
- "_networkInterface": "Interfaccia di rete"
8
+ "_networkInterface": "Interfaccia di rete",
9
+ "datapoint.model": "Modello specifico della Lampada",
10
+ "datapoint.ip": "Indirizzo IP della Lampada",
11
+ "datapoint.bleVersionHard": "Versione hardware Bluetooth a basso consumo energetico",
12
+ "datapoint.bleVersionSoft": "Versione del software Bluetooth a basso consumo energetico",
13
+ "datapoint.wifiVersionHard": "Versione hardware Wi-Fi",
14
+ "datapoint.wifiVersionSoft": "Versione del software Wi-Fi",
15
+ "_networkHint": "Utenti Windows: potrebbe essere necessario selezionare manualmente il proprio indirizzo IP, poiché l'ascolto su tutte le interfacce potrebbe non funzionare in modo affidabile.",
16
+ "_manualIpAddresses": "Indirizzi IP manuali",
17
+ "_manualIpHint": "Puoi aggiungere qui gli indirizzi IP per i dispositivi che non sono stati rilevati automaticamente.",
18
+ "_disableAutoDiscovery": "Disabilita il rilevamento automatico",
19
+ "_discoveredDevicesHint": "Tutti i dispositivi rilevati (auto e manuale) possono essere trovati in Oggetti → govee-local.0 → informazioni → discoveredDevices",
20
+ "_discoveredDevices": "Dispositivi rilevati"
9
21
  }
@@ -5,5 +5,17 @@
5
5
  "_configDescription": "Er is niets verplicht om te configureren. Wijzig de intervallen alleen als u zeker weet dat dit is wat u nodig heeft",
6
6
  "_extendedLoggingDescription": "Uitgebreide logboekregistratie drukt alle door het apparaat ontvangen gegevens af naar het logboek met niveau-informatie. Omdat dit een enorme log-spam veroorzaakt, is het aan te raden dit alleen in te schakelen als dat nodig is en daarna weer uit te schakelen.",
7
7
  "_extendedLogging": "Uitgebreide logboekregistratie ingeschakeld",
8
- "_networkInterface": "Netwerkinterface"
8
+ "_networkInterface": "Netwerkinterface",
9
+ "datapoint.model": "Specifiek model van de lamp",
10
+ "datapoint.ip": "IP-adres van de lamp",
11
+ "datapoint.bleVersionHard": "Bluetooth Low Energy-hardwareversie",
12
+ "datapoint.bleVersionSoft": "Bluetooth Low Energy-softwareversie",
13
+ "datapoint.wifiVersionHard": "WiFi-hardwareversie",
14
+ "datapoint.wifiVersionSoft": "WiFi-softwareversie",
15
+ "_networkHint": "Windows-gebruikers: Mogelijk moet u uw IP-adres handmatig selecteren, omdat het luisteren op alle interfaces mogelijk niet betrouwbaar werkt.",
16
+ "_manualIpAddresses": "Handmatige IP-adressen",
17
+ "_manualIpHint": "U kunt hier IP-adressen toevoegen voor apparaten die niet automatisch zijn ontdekt.",
18
+ "_disableAutoDiscovery": "Schakel automatische detectie uit",
19
+ "_discoveredDevicesHint": "Alle ontdekte apparaten (automatisch en handmatig) zijn te vinden in Objecten → govee-local.0 → info → ontdekte apparaten",
20
+ "_discoveredDevices": "Ontdekte apparaten"
9
21
  }
@@ -5,5 +5,17 @@
5
5
  "_configDescription": "Nie ma nic obowiązkowego do skonfigurowania. Zmień interwały tylko wtedy, gdy jesteś pewien, że tego właśnie potrzebujesz",
6
6
  "_extendedLoggingDescription": "Rozszerzone rejestrowanie drukuje wszystkie dane otrzymane przez urządzenie w dzienniku z informacjami o poziomie. Ponieważ powoduje to powstawanie ogromnego spamu w dziennikach, zaleca się włączenie tej opcji tylko w razie potrzeby, a następnie wyłączenie jej ponownie.",
7
7
  "_extendedLogging": "Włączono rozszerzone rejestrowanie",
8
- "_networkInterface": "Interfejs sieciowy"
8
+ "_networkInterface": "Interfejs sieciowy",
9
+ "datapoint.model": "Konkretny model lampy",
10
+ "datapoint.ip": "Adres IP Lampy",
11
+ "datapoint.bleVersionHard": "Wersja sprzętu Bluetooth o niskim zużyciu energii",
12
+ "datapoint.bleVersionSoft": "Wersja oprogramowania Bluetooth Low Energy",
13
+ "datapoint.wifiVersionHard": "Wersja sprzętu Wi-Fi",
14
+ "datapoint.wifiVersionSoft": "Wersja oprogramowania Wi-Fi",
15
+ "_networkHint": "Użytkownicy systemu Windows: Może być konieczne ręczne wybranie adresu IP, ponieważ nasłuchiwanie na wszystkich interfejsach może nie działać niezawodnie.",
16
+ "_manualIpAddresses": "Ręczne adresy IP",
17
+ "_manualIpHint": "Możesz tutaj dodać adresy IP dla urządzeń, które nie zostały automatycznie wykryte.",
18
+ "_disableAutoDiscovery": "Wyłącz automatyczne wykrywanie",
19
+ "_discoveredDevicesHint": "Wszystkie wykryte urządzenia (automatyczne i ręczne) można znaleźć w Obiekty → govee-local.0 → info → discoveredDevices",
20
+ "_discoveredDevices": "Odkryte urządzenia"
9
21
  }
@@ -5,5 +5,17 @@
5
5
  "_configDescription": "Não há nada obrigatório para configurar. Por favor, altere os intervalos somente quando tiver certeza de que é isso que você precisa",
6
6
  "_extendedLoggingDescription": "O Extended Logging imprime todos os dados recebidos pelo dispositivo no log com informações de nível. Como isso produz um grande spam de log, é recomendável ativá-lo somente quando necessário e desligá-lo novamente depois.",
7
7
  "_extendedLogging": "Registro estendido ativado",
8
- "_networkInterface": "Interface de rede"
8
+ "_networkInterface": "Interface de rede",
9
+ "datapoint.model": "Modelo específico da Lâmpada",
10
+ "datapoint.ip": "Endereço IP da lâmpada",
11
+ "datapoint.bleVersionHard": "Versão de hardware Bluetooth de baixo consumo de energia",
12
+ "datapoint.bleVersionSoft": "Versão do software Bluetooth de baixo consumo de energia",
13
+ "datapoint.wifiVersionHard": "Versão de hardware WiFi",
14
+ "datapoint.wifiVersionSoft": "Versão do software Wi-Fi",
15
+ "_networkHint": "Usuários do Windows: talvez seja necessário selecionar seu endereço IP manualmente, pois a escuta em todas as interfaces pode não funcionar de maneira confiável.",
16
+ "_manualIpAddresses": "Endereços IP manuais",
17
+ "_manualIpHint": "Você pode adicionar endereços IP aqui para dispositivos que não foram descobertos automaticamente.",
18
+ "_disableAutoDiscovery": "Desativar descoberta automática",
19
+ "_discoveredDevicesHint": "Todos os dispositivos descobertos (automáticos e manuais) podem ser encontrados em Objetos → govee-local.0 → informações → dispositivos descobertos",
20
+ "_discoveredDevices": "Dispositivos descobertos"
9
21
  }
@@ -5,5 +5,17 @@
5
5
  "_configDescription": "Нет ничего обязательного для настройки. Пожалуйста, меняйте интервалы только тогда, когда вы уверены, что это то, что вам нужно.",
6
6
  "_extendedLoggingDescription": "Расширенная регистрация записывает все данные, полученные устройством, в журнал с информацией об уровне. Поскольку это приводит к большому количеству спама в журналах, рекомендуется включать эту функцию только при необходимости, а затем снова выключать.",
7
7
  "_extendedLogging": "Расширенное ведение журнала включено",
8
- "_networkInterface": "Сетевой интерфейс"
8
+ "_networkInterface": "Сетевой интерфейс",
9
+ "datapoint.model": "Конкретная модель лампы",
10
+ "datapoint.ip": "IP-адрес лампы",
11
+ "datapoint.bleVersionHard": "Аппаратная версия Bluetooth с низким энергопотреблением",
12
+ "datapoint.bleVersionSoft": "Версия программного обеспечения Bluetooth с низким энергопотреблением",
13
+ "datapoint.wifiVersionHard": "Версия оборудования Wi-Fi",
14
+ "datapoint.wifiVersionSoft": "Версия программного обеспечения Wi-Fi",
15
+ "_networkHint": "Пользователи Windows: возможно, вам придется выбрать IP-адрес вручную, поскольку прослушивание всех интерфейсов может работать ненадежно.",
16
+ "_manualIpAddresses": "IP-адреса вручную",
17
+ "_manualIpHint": "Здесь вы можете добавить IP-адреса для устройств, которые не были обнаружены автоматически.",
18
+ "_disableAutoDiscovery": "Отключить автоматическое обнаружение",
19
+ "_discoveredDevicesHint": "Все обнаруженные устройства (автоматические и ручные) можно найти в Objects → govee-local.0 → info → discoveredDevices.",
20
+ "_discoveredDevices": "Обнаруженные устройства"
9
21
  }
@@ -5,5 +5,17 @@
5
5
  "_configDescription": "Немає нічого обов’язкового для налаштування. Будь ласка, змінюйте інтервали лише тоді, коли ви впевнені, що це те, що вам потрібно",
6
6
  "_extendedLoggingDescription": "Extended Logging друкує всі дані, отримані пристроєм, у журналі з інформацією про рівень. Оскільки це створює величезну кількість спаму в журналі, рекомендується вмикати це лише за потреби, а потім знову вимикати.",
7
7
  "_extendedLogging": "Розширене журналювання ввімкнено",
8
- "_networkInterface": "Мережевий інтерфейс"
8
+ "_networkInterface": "Мережевий інтерфейс",
9
+ "datapoint.model": "Конкретна модель лампи",
10
+ "datapoint.ip": "IP-адреса лампи",
11
+ "datapoint.bleVersionHard": "Апаратна версія Bluetooth Low Energy",
12
+ "datapoint.bleVersionSoft": "Версія програмного забезпечення Bluetooth Low Energy",
13
+ "datapoint.wifiVersionHard": "Версія обладнання WiFi",
14
+ "datapoint.wifiVersionSoft": "Версія програмного забезпечення WiFi",
15
+ "_networkHint": "Користувачі Windows: можливо, вам доведеться вибрати свою IP-адресу вручну, оскільки прослуховування на всіх інтерфейсах може працювати ненадійно.",
16
+ "_manualIpAddresses": "IP-адреси вручну",
17
+ "_manualIpHint": "Тут можна додати IP-адреси для пристроїв, які не були виявлені автоматично.",
18
+ "_disableAutoDiscovery": "Вимкнути автоматичне виявлення",
19
+ "_discoveredDevicesHint": "Усі виявлені пристрої (автоматичні та ручні) можна знайти в Objects → govee-local.0 → info → discoveredDevices",
20
+ "_discoveredDevices": "Виявлені пристрої"
9
21
  }
@@ -5,5 +5,17 @@
5
5
  "_configDescription": "没有什么必须配置的。仅当您确定这是您需要的时才更改间隔",
6
6
  "_extendedLoggingDescription": "扩展日志记录将设备接收到的所有数据打印到带有级别信息的日志中。由于这会产生大量日志垃圾邮件,因此建议仅在需要时打开此功能,然后再次关闭。",
7
7
  "_extendedLogging": "启用扩展日志记录",
8
- "_networkInterface": "网络接口"
8
+ "_networkInterface": "网络接口",
9
+ "datapoint.model": "灯的具体型号",
10
+ "datapoint.ip": "灯的IP地址",
11
+ "datapoint.bleVersionHard": "蓝牙低功耗硬件版本",
12
+ "datapoint.bleVersionSoft": "低功耗蓝牙软件版本",
13
+ "datapoint.wifiVersionHard": "WiFi硬件版本",
14
+ "datapoint.wifiVersionSoft": "WiFi软件版本",
15
+ "_networkHint": "Windows 用户:您可能需要手动选择 IP 地址,因为侦听所有接口可能无法可靠地工作。",
16
+ "_manualIpAddresses": "手动 IP 地址",
17
+ "_manualIpHint": "您可以在此处为未自动发现的设备添加 IP 地址。",
18
+ "_disableAutoDiscovery": "禁用自动发现",
19
+ "_discoveredDevicesHint": "所有发现的设备(自动和手动)都可以在对象 → govee-local.0 → 信息 →discoveredDevices 中找到",
20
+ "_discoveredDevices": "发现的设备"
9
21
  }
@@ -2,14 +2,34 @@
2
2
  "i18n": true,
3
3
  "type": "panel",
4
4
  "items": {
5
- "_description": {
5
+ "networkHeader": {
6
+ "type": "header",
7
+ "text": "Network",
8
+ "size": 2,
9
+ "xs": 12
10
+ },
11
+ "networkHint": {
6
12
  "type": "staticText",
13
+ "text": "_networkHint",
14
+ "xs": 12
15
+ },
16
+ "interface": {
17
+ "type": "ip",
18
+ "listenOnAllPorts": true,
19
+ "onlyIp4": true,
20
+ "label": "_networkInterface",
21
+ "newLine": true,
7
22
  "xs": 12,
8
23
  "sm": 12,
9
- "md": 12,
10
- "lg": 12,
11
- "xl": 12,
12
- "text": "_configDescription"
24
+ "md": 6,
25
+ "lg": 4,
26
+ "xl": 4
27
+ },
28
+ "intervalsHeader": {
29
+ "type": "header",
30
+ "text": "Intervals",
31
+ "size": 2,
32
+ "xs": 12
13
33
  },
14
34
  "searchInterval": {
15
35
  "type": "number",
@@ -33,17 +53,49 @@
33
53
  "xl": 2,
34
54
  "label": "_deviceStatusRefreshInterval"
35
55
  },
36
- "interface": {
37
- "type": "ip",
38
- "listenOnAllPorts": true,
39
- "onlyIp4": true,
40
- "label": "_networkInterface",
41
- "newLine": true,
56
+ "manualIpHeader": {
57
+ "type": "header",
58
+ "text": "_manualIpAddresses",
59
+ "size": 2,
60
+ "xs": 12
61
+ },
62
+ "manualIpHint": {
63
+ "type": "staticText",
64
+ "text": "_manualIpHint",
65
+ "xs": 12
66
+ },
67
+ "discoveredDevicesHint": {
68
+ "type": "staticText",
69
+ "text": "_discoveredDevicesHint",
42
70
  "xs": 12,
43
- "sm": 12,
44
- "md": 6,
45
- "lg": 4,
46
- "xl": 4
71
+ "newLine": true
72
+ },
73
+ "discoveredDevicesState": {
74
+ "type": "state",
75
+ "oid": "info.discoveredDevices",
76
+ "system": true,
77
+ "control": "html",
78
+ "label": "_discoveredDevices",
79
+ "readOnly": true,
80
+ "xs": 12,
81
+ "newLine": true
82
+ },
83
+ "manualIpTable": {
84
+ "type": "chips",
85
+ "label": "_manualIpAddresses",
86
+ "xs": 12
87
+ },
88
+ "disableAutoDiscovery": {
89
+ "type": "checkbox",
90
+ "label": "_disableAutoDiscovery",
91
+ "default": false,
92
+ "xs": 12
93
+ },
94
+ "loggingHeader": {
95
+ "type": "header",
96
+ "text": "Logging",
97
+ "size": 2,
98
+ "xs": 12
47
99
  },
48
100
  "_descriptionExtendedLogging": {
49
101
  "type": "staticText",
@@ -34,6 +34,7 @@ module.exports = __toCommonJS(goveeService_exports);
34
34
  var dgram = __toESM(require("node:dgram"));
35
35
  var import_node_events = require("node:events");
36
36
  var import_hexTool = require("./tools/hexTool");
37
+ var import_ipValidation = require("./tools/ipValidation");
37
38
  class GoveeService extends import_node_events.EventEmitter {
38
39
  socket;
39
40
  options;
@@ -72,7 +73,7 @@ class GoveeService extends import_node_events.EventEmitter {
72
73
  );
73
74
  }
74
75
  serverBound() {
75
- var _a;
76
+ var _a, _b, _c, _d;
76
77
  this.socket.setBroadcast(true);
77
78
  this.socket.setMulticastTTL(128);
78
79
  this.socket.setMulticastInterface(this.options.interface);
@@ -80,7 +81,18 @@ class GoveeService extends import_node_events.EventEmitter {
80
81
  (_a = this.options.logger) == null ? void 0 : _a.debug(
81
82
  `UDP listening on ${this.socket.address().address}:${this.socket.address().port}`
82
83
  );
83
- this.searchInterval = setInterval(() => this.sendScan(), this.options.searchInterval * 1e3);
84
+ if (this.options.manualIpAddresses && this.options.manualIpAddresses.length > 0) {
85
+ this.addManualDevices(this.options.manualIpAddresses);
86
+ (_b = this.options.logger) == null ? void 0 : _b.info(
87
+ `Added ${this.options.manualIpAddresses.length} manual device(s) from configuration.`
88
+ );
89
+ }
90
+ if (!this.options.disableAutoDiscovery) {
91
+ this.searchInterval = setInterval(() => this.sendScan(), this.options.searchInterval * 1e3);
92
+ (_c = this.options.logger) == null ? void 0 : _c.info(`Auto-discovery started with interval ${this.options.searchInterval} seconds.`);
93
+ } else {
94
+ (_d = this.options.logger) == null ? void 0 : _d.info("Auto-discovery is disabled. Only manual devices will be used.");
95
+ }
84
96
  this.refreshInterval = setInterval(
85
97
  () => this.refreshAllDevices(),
86
98
  this.options.deviceStatusRefreshInterval * 1e3
@@ -164,6 +176,33 @@ class GoveeService extends import_node_events.EventEmitter {
164
176
  GoveeService.M_CAST
165
177
  );
166
178
  }
179
+ /**
180
+ * Add manual devices by IP address without discovery.
181
+ * These devices will be added to the device list and can be controlled.
182
+ *
183
+ * @param ipAddresses Array of IP addresses to add as manual devices.
184
+ */
185
+ addManualDevices(ipAddresses) {
186
+ var _a, _b;
187
+ for (const ip of ipAddresses) {
188
+ if (!ip || ip.trim().length === 0) {
189
+ continue;
190
+ }
191
+ const trimmedIp = ip.trim();
192
+ if (!(0, import_ipValidation.isValidIpAddress)(trimmedIp)) {
193
+ (_a = this.options.logger) == null ? void 0 : _a.error(`Invalid IP address format: "${trimmedIp}" - skipping this entry`);
194
+ continue;
195
+ }
196
+ const deviceName = `Manual_${trimmedIp.replace(/\./g, "_")}`;
197
+ this.devices[trimmedIp] = deviceName;
198
+ (_b = this.options.logger) == null ? void 0 : _b.info(`Added manual device: ${deviceName} at ${trimmedIp}`);
199
+ this.emit("deviceDiscovered", {
200
+ ip: trimmedIp,
201
+ deviceName
202
+ });
203
+ this.requestDeviceStatus(trimmedIp);
204
+ }
205
+ }
167
206
  /**
168
207
  * Stop all intervals and close the socket.
169
208
  */
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/lib/goveeService.ts"],
4
- "sourcesContent": ["/**\n * GoveeService handles all business logic for device discovery, status updates, and UDP communication.\n * This class is independent from ioBroker.Adapter and can be tested separately.\n */\n\nimport * as dgram from 'node:dgram';\nimport { EventEmitter } from 'node:events';\nimport type { GoveeServiceOptions } from './goveeServiceOptions';\nimport { componentToHex, hexToRgb } from './tools/hexTool';\n\n/**\n * Device discovery event data.\n */\nexport interface DeviceDiscoveryEvent {\n\t/** The IP address of the discovered device. */\n\tip: string;\n\t/** The sanitized device name. */\n\tdeviceName: string;\n}\n\n/**\n * Device status update event data.\n */\nexport interface DeviceStatusEvent {\n\t/** The sanitized device name. */\n\tdeviceName: string;\n\t/** The IP address of the device. */\n\tip: string;\n\t/** The current status of the device. */\n\tstatus: {\n\t\t/** Current on/off state. */\n\t\tonOff: boolean;\n\t\t/** Current brightness level. */\n\t\tbrightness: number;\n\t\t/** Current color as hex string. */\n\t\tcolor: string;\n\t\t/** Current color temperature in Kelvin. */\n\t\tcolorTemInKelvin: number;\n\t};\n}\n\n/**\n * GoveeService handles all business logic for device discovery, status updates, and UDP communication.\n * This class is independent from ioBroker.Adapter and can be tested separately.\n *\n * Events:\n * - 'deviceDiscovered': Emitted when a new device is found\n * - 'deviceStatusUpdate': Emitted when device status is updated\n *\n * Usage:\n * const service = new GoveeService(options);\n * service.on('deviceDiscovered', (data) => { ... });\n * service.on('deviceStatusUpdate', (data) => { ... });\n * service.start();\n * // ...\n * service.stop();\n */\nexport class GoveeService extends EventEmitter {\n\tprivate socket: dgram.Socket;\n\tprivate options: GoveeServiceOptions;\n\tprivate devices: { [ip: string]: string } = {};\n\tprivate loggedDevices: string[] = [];\n\tprivate searchInterval?: NodeJS.Timeout;\n\tprivate refreshInterval?: NodeJS.Timeout;\n\n\tstatic readonly LOCAL_PORT = 4002;\n\tstatic readonly SEND_SCAN_PORT = 4001;\n\tstatic readonly CONTROL_PORT = 4003;\n\tstatic readonly M_CAST = '239.255.255.250';\n\tstatic readonly scanMessage = { msg: { cmd: 'scan', data: { account_topic: 'reserved' } } };\n\tstatic readonly requestStatusMessage = { msg: { cmd: 'devStatus', data: {} } };\n\n\t/**\n\t * Create a new GoveeService instance.\n\t *\n\t * @param options Configuration options for the service.\n\t */\n\tconstructor(options: GoveeServiceOptions) {\n\t\tsuper();\n\t\tthis.options = options;\n\t\tthis.socket = dgram.createSocket({ type: 'udp4' });\n\t}\n\n\t/**\n\t * Bind UDP socket and start device search/refresh intervals.\n\t */\n\tpublic start(): void {\n\t\tthis.socket.on('message', this.onUdpMessage.bind(this));\n\t\tthis.socket.on('error', (error) => {\n\t\t\tthis.options.logger?.error(`server bind error : ${error.message}`);\n\t\t});\n\t\tthis.socket.bind(\n\t\t\t{ address: this.options.interface, port: GoveeService.LOCAL_PORT },\n\t\t\tthis.serverBound.bind(this),\n\t\t);\n\t}\n\n\tprivate serverBound(): void {\n\t\tthis.socket.setBroadcast(true);\n\t\tthis.socket.setMulticastTTL(128);\n\t\tthis.socket.setMulticastInterface(this.options.interface);\n\t\tthis.socket.addMembership(GoveeService.M_CAST);\n\t\tthis.options.logger?.debug(\n\t\t\t`UDP listening on ${(this.socket.address() as any).address}:${(this.socket.address() as any).port}`,\n\t\t);\n\t\tthis.searchInterval = setInterval(() => this.sendScan(), this.options.searchInterval * 1000);\n\t\tthis.refreshInterval = setInterval(\n\t\t\t() => this.refreshAllDevices(),\n\t\t\tthis.options.deviceStatusRefreshInterval * 1000,\n\t\t);\n\t}\n\n\t/**\n\t * Handle incoming UDP messages.\n\t *\n\t * @param message The message buffer.\n\t * @param remote The sender info.\n\t */\n\tprivate onUdpMessage(message: Buffer, remote: dgram.RemoteInfo): void {\n\t\tconst messageObject = JSON.parse(message.toString());\n\t\tswitch (messageObject.msg.cmd) {\n\t\t\tcase 'scan': {\n\t\t\t\tif (messageObject.msg.data.device) {\n\t\t\t\t\tconst deviceName = messageObject.msg.data.device.replace(\n\t\t\t\t\t\tthis.options.forbiddenChars ?? /[^a-zA-Z0-9_-]/g,\n\t\t\t\t\t\t'_',\n\t\t\t\t\t);\n\t\t\t\t\tthis.devices[remote.address] = deviceName;\n\t\t\t\t\tthis.emit('deviceDiscovered', {\n\t\t\t\t\t\tip: remote.address,\n\t\t\t\t\t\tdeviceName: deviceName,\n\t\t\t\t\t} as DeviceDiscoveryEvent);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 'devStatus': {\n\t\t\t\tconst sendingDevice = this.devices[remote.address];\n\t\t\t\tif (sendingDevice) {\n\t\t\t\t\tif (this.options.extendedLogging && !this.loggedDevices.includes(remote.address.toString())) {\n\t\t\t\t\t\tthis.options.logger?.info(`device status message data: ${JSON.stringify(messageObject)}`);\n\t\t\t\t\t\tthis.loggedDevices.push(remote.address.toString());\n\t\t\t\t\t}\n\t\t\t\t\tthis.emitDeviceStatusUpdate(sendingDevice, remote.address, messageObject);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdefault: {\n\t\t\t\tthis.options.logger?.debug(`message from: ${remote.address}:${remote.port} - ${message.toString()}`);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Send device status request to all known devices.\n\t */\n\tpublic refreshAllDevices(): void {\n\t\tfor (const ip in this.devices) {\n\t\t\tthis.requestDeviceStatus(ip);\n\t\t}\n\t}\n\n\t/**\n\t * Send device status request to a specific device.\n\t *\n\t * @param receiver The IP address or hostname of the device.\n\t */\n\tpublic requestDeviceStatus(receiver: string): void {\n\t\tconst requestDeviceStatusBuffer = Buffer.from(JSON.stringify(GoveeService.requestStatusMessage));\n\t\tthis.socket.send(\n\t\t\trequestDeviceStatusBuffer,\n\t\t\t0,\n\t\t\trequestDeviceStatusBuffer.length,\n\t\t\tGoveeService.CONTROL_PORT,\n\t\t\treceiver,\n\t\t);\n\t}\n\n\t/**\n\t * Send scan message to the UDP multicast address.\n\t */\n\tpublic sendScan(): void {\n\t\tthis.options.logger?.debug('sending scan message');\n\t\tconst scanMessageBuffer = Buffer.from(JSON.stringify(GoveeService.scanMessage));\n\t\tthis.socket.send(\n\t\t\tscanMessageBuffer,\n\t\t\t0,\n\t\t\tscanMessageBuffer.length,\n\t\t\tGoveeService.SEND_SCAN_PORT,\n\t\t\tGoveeService.M_CAST,\n\t\t);\n\t}\n\n\t/**\n\t * Stop all intervals and close the socket.\n\t */\n\tpublic stop(): void {\n\t\tif (this.searchInterval) {\n\t\t\tclearInterval(this.searchInterval);\n\t\t}\n\t\tif (this.refreshInterval) {\n\t\t\tclearInterval(this.refreshInterval);\n\t\t}\n\t\tthis.socket.close();\n\t}\n\n\t/**\n\t * Get all known devices.\n\t */\n\tpublic getDevices(): { [ip: string]: string } {\n\t\treturn this.devices;\n\t}\n\n\t/**\n\t * Handles a state change and sends the appropriate command to the device.\n\t *\n\t * @param id The state ID\n\t * @param state The new state object\n\t * @param receiver The device IP as string\n\t */\n\tpublic handleStateChange(id: string, state: ioBroker.State, receiver: string): void {\n\t\tconst stateKey = id.split('.')[4];\n\t\tswitch (stateKey) {\n\t\t\tcase 'onOff':\n\t\t\t\tthis.sendTurnCommand(receiver, !!state.val);\n\t\t\t\tbreak;\n\t\t\tcase 'brightness':\n\t\t\t\tthis.sendBrightnessCommand(receiver, Number(state.val));\n\t\t\t\tbreak;\n\t\t\tcase 'colorTemInKelvin':\n\t\t\t\tthis.sendColorTempCommand(receiver, Number(state.val));\n\t\t\t\tbreak;\n\t\t\tcase 'color': {\n\t\t\t\tconst colorValue = state.val?.toString();\n\t\t\t\tif (colorValue) {\n\t\t\t\t\tthis.sendColorCommand(receiver, colorValue);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\t/**\n\t * Send a turn on/off command to a device.\n\t *\n\t * @param receiver IP address or hostname\n\t * @param value true for on, false for off\n\t */\n\tpublic sendTurnCommand(receiver: string, value: boolean): void {\n\t\tconst turnMessage = { msg: { cmd: 'turn', data: { value: value ? 1 : 0 } } };\n\t\tconst turnMessageBuffer = Buffer.from(JSON.stringify(turnMessage));\n\t\tthis.socket.send(turnMessageBuffer, 0, turnMessageBuffer.length, GoveeService.CONTROL_PORT, receiver);\n\t}\n\n\t/**\n\t * Send a brightness command to a device.\n\t *\n\t * @param receiver IP address or hostname\n\t * @param value Brightness value\n\t */\n\tpublic sendBrightnessCommand(receiver: string, value: number): void {\n\t\tconst brightnessMessage = { msg: { cmd: 'brightness', data: { value } } };\n\t\tconst brightnessMessageBuffer = Buffer.from(JSON.stringify(brightnessMessage));\n\t\tthis.socket.send(\n\t\t\tbrightnessMessageBuffer,\n\t\t\t0,\n\t\t\tbrightnessMessageBuffer.length,\n\t\t\tGoveeService.CONTROL_PORT,\n\t\t\treceiver,\n\t\t);\n\t}\n\n\t/**\n\t * Send a color temperature command to a device.\n\t *\n\t * @param receiver IP address or hostname\n\t * @param kelvin Color temperature in Kelvin\n\t */\n\tpublic sendColorTempCommand(receiver: string, kelvin: number): void {\n\t\tconst colorTempMessageBuffer = Buffer.from(\n\t\t\tJSON.stringify({\n\t\t\t\tmsg: {\n\t\t\t\t\tcmd: 'colorwc',\n\t\t\t\t\tdata: { color: { r: 0, g: 0, b: 0 }, colorTemInKelvin: kelvin },\n\t\t\t\t},\n\t\t\t}),\n\t\t);\n\t\tthis.socket.send(colorTempMessageBuffer, 0, colorTempMessageBuffer.length, GoveeService.CONTROL_PORT, receiver);\n\t}\n\n\t/**\n\t * Send a color command to a device.\n\t *\n\t * @param receiver IP address or hostname\n\t * @param hexColor Color as hex string (e.g. #FFAABB)\n\t */\n\tpublic sendColorCommand(receiver: string, hexColor: string): void {\n\t\tconst rgb = hexToRgb(hexColor);\n\t\tconst colorMessage = { msg: { cmd: 'colorwc', data: { color: rgb } } };\n\t\tconst colorMessageBuffer = Buffer.from(JSON.stringify(colorMessage));\n\t\tthis.socket.send(colorMessageBuffer, 0, colorMessageBuffer.length, GoveeService.CONTROL_PORT, receiver);\n\t}\n\n\t/**\n\t * Emit device status update event with parsed status data.\n\t *\n\t * @param deviceName The device name.\n\t * @param ip The device IP address.\n\t * @param messageObject The parsed message object containing device status.\n\t */\n\tprivate emitDeviceStatusUpdate(deviceName: string, ip: string, messageObject: any): void {\n\t\tconst deviceData = messageObject.msg.data;\n\t\tconst colorString = `#${componentToHex(deviceData.color.r)}${componentToHex(deviceData.color.g)}${componentToHex(deviceData.color.b)}`;\n\n\t\tthis.emit('deviceStatusUpdate', {\n\t\t\tdeviceName: deviceName,\n\t\t\tip: ip,\n\t\t\tstatus: {\n\t\t\t\tonOff: deviceData.onOff === 1,\n\t\t\t\tbrightness: deviceData.brightness,\n\t\t\t\tcolor: colorString,\n\t\t\t\tcolorTemInKelvin: deviceData.colorTemInKelvin,\n\t\t\t},\n\t\t} as DeviceStatusEvent);\n\t}\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA,YAAuB;AACvB,yBAA6B;AAE7B,qBAAyC;AAiDlC,MAAM,qBAAqB,gCAAa;AAAA,EACtC;AAAA,EACA;AAAA,EACA,UAAoC,CAAC;AAAA,EACrC,gBAA0B,CAAC;AAAA,EAC3B;AAAA,EACA;AAAA,EAER,OAAgB,aAAa;AA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B,OAAO,KAAK,KAAK,UAAU,YAAY,CAAC;AACnE,SAAK,OAAO,KAAK,oBAAoB,GAAG,mBAAmB,QAAQ,aAAa,cAAc,QAAQ;AAAA,EACvG;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASQ,uBAAuB,YAAoB,IAAY,eAA0B;AACxF,UAAM,aAAa,cAAc,IAAI;AACrC,UAAM,cAAc,QAAI,+BAAe,WAAW,MAAM,CAAC,CAAC,OAAG,+BAAe,WAAW,MAAM,CAAC,CAAC,OAAG,+BAAe,WAAW,MAAM,CAAC,CAAC;AAEpI,SAAK,KAAK,sBAAsB;AAAA,MAC/B;AAAA,MACA;AAAA,MACA,QAAQ;AAAA,QACP,OAAO,WAAW,UAAU;AAAA,QAC5B,YAAY,WAAW;AAAA,QACvB,OAAO;AAAA,QACP,kBAAkB,WAAW;AAAA,MAC9B;AAAA,IACD,CAAsB;AAAA,EACvB;AACD;",
4
+ "sourcesContent": ["/**\n * GoveeService handles all business logic for device discovery, status updates, and UDP communication.\n * This class is independent from ioBroker.Adapter and can be tested separately.\n */\n\nimport * as dgram from 'node:dgram';\nimport { EventEmitter } from 'node:events';\nimport type { GoveeServiceOptions } from './goveeServiceOptions';\nimport { componentToHex, hexToRgb } from './tools/hexTool';\nimport { isValidIpAddress } from './tools/ipValidation';\n\n/**\n * Device discovery event data.\n */\nexport interface DeviceDiscoveryEvent {\n\t/** The IP address of the discovered device. */\n\tip: string;\n\t/** The sanitized device name. */\n\tdeviceName: string;\n}\n\n/**\n * Device status update event data.\n */\nexport interface DeviceStatusEvent {\n\t/** The sanitized device name. */\n\tdeviceName: string;\n\t/** The IP address of the device. */\n\tip: string;\n\t/** The current status of the device. */\n\tstatus: {\n\t\t/** Current on/off state. */\n\t\tonOff: boolean;\n\t\t/** Current brightness level. */\n\t\tbrightness: number;\n\t\t/** Current color as hex string. */\n\t\tcolor: string;\n\t\t/** Current color temperature in Kelvin. */\n\t\tcolorTemInKelvin: number;\n\t};\n}\n\n/**\n * GoveeService handles all business logic for device discovery, status updates, and UDP communication.\n * This class is independent from ioBroker.Adapter and can be tested separately.\n *\n * Events:\n * - 'deviceDiscovered': Emitted when a new device is found\n * - 'deviceStatusUpdate': Emitted when device status is updated\n *\n * Usage:\n * const service = new GoveeService(options);\n * service.on('deviceDiscovered', (data) => { ... });\n * service.on('deviceStatusUpdate', (data) => { ... });\n * service.start();\n * // ...\n * service.stop();\n */\nexport class GoveeService extends EventEmitter {\n\tprivate socket: dgram.Socket;\n\tprivate options: GoveeServiceOptions;\n\tprivate devices: { [ip: string]: string } = {};\n\tprivate loggedDevices: string[] = [];\n\tprivate searchInterval?: NodeJS.Timeout;\n\tprivate refreshInterval?: NodeJS.Timeout;\n\n\tstatic readonly LOCAL_PORT = 4002;\n\tstatic readonly SEND_SCAN_PORT = 4001;\n\tstatic readonly CONTROL_PORT = 4003;\n\tstatic readonly M_CAST = '239.255.255.250';\n\tstatic readonly scanMessage = { msg: { cmd: 'scan', data: { account_topic: 'reserved' } } };\n\tstatic readonly requestStatusMessage = { msg: { cmd: 'devStatus', data: {} } };\n\n\t/**\n\t * Create a new GoveeService instance.\n\t *\n\t * @param options Configuration options for the service.\n\t */\n\tconstructor(options: GoveeServiceOptions) {\n\t\tsuper();\n\t\tthis.options = options;\n\t\tthis.socket = dgram.createSocket({ type: 'udp4' });\n\t}\n\n\t/**\n\t * Bind UDP socket and start device search/refresh intervals.\n\t */\n\tpublic start(): void {\n\t\tthis.socket.on('message', this.onUdpMessage.bind(this));\n\t\tthis.socket.on('error', (error) => {\n\t\t\tthis.options.logger?.error(`server bind error : ${error.message}`);\n\t\t});\n\t\tthis.socket.bind(\n\t\t\t{ address: this.options.interface, port: GoveeService.LOCAL_PORT },\n\t\t\tthis.serverBound.bind(this),\n\t\t);\n\t}\n\n\tprivate serverBound(): void {\n\t\tthis.socket.setBroadcast(true);\n\t\tthis.socket.setMulticastTTL(128);\n\t\tthis.socket.setMulticastInterface(this.options.interface);\n\t\tthis.socket.addMembership(GoveeService.M_CAST);\n\t\tthis.options.logger?.debug(\n\t\t\t`UDP listening on ${(this.socket.address() as any).address}:${(this.socket.address() as any).port}`,\n\t\t);\n\n\t\t// Add manual IP addresses if provided\n\t\tif (this.options.manualIpAddresses && this.options.manualIpAddresses.length > 0) {\n\t\t\tthis.addManualDevices(this.options.manualIpAddresses);\n\t\t\tthis.options.logger?.info(\n\t\t\t\t`Added ${this.options.manualIpAddresses.length} manual device(s) from configuration.`,\n\t\t\t);\n\t\t}\n\n\t\t// Only start auto-discovery if not disabled\n\t\tif (!this.options.disableAutoDiscovery) {\n\t\t\tthis.searchInterval = setInterval(() => this.sendScan(), this.options.searchInterval * 1000);\n\t\t\tthis.options.logger?.info(`Auto-discovery started with interval ${this.options.searchInterval} seconds.`);\n\t\t} else {\n\t\t\tthis.options.logger?.info('Auto-discovery is disabled. Only manual devices will be used.');\n\t\t}\n\n\t\tthis.refreshInterval = setInterval(\n\t\t\t() => this.refreshAllDevices(),\n\t\t\tthis.options.deviceStatusRefreshInterval * 1000,\n\t\t);\n\t}\n\n\t/**\n\t * Handle incoming UDP messages.\n\t *\n\t * @param message The message buffer.\n\t * @param remote The sender info.\n\t */\n\tprivate onUdpMessage(message: Buffer, remote: dgram.RemoteInfo): void {\n\t\tconst messageObject = JSON.parse(message.toString());\n\t\tswitch (messageObject.msg.cmd) {\n\t\t\tcase 'scan': {\n\t\t\t\tif (messageObject.msg.data.device) {\n\t\t\t\t\tconst deviceName = messageObject.msg.data.device.replace(\n\t\t\t\t\t\tthis.options.forbiddenChars ?? /[^a-zA-Z0-9_-]/g,\n\t\t\t\t\t\t'_',\n\t\t\t\t\t);\n\t\t\t\t\tthis.devices[remote.address] = deviceName;\n\t\t\t\t\tthis.emit('deviceDiscovered', {\n\t\t\t\t\t\tip: remote.address,\n\t\t\t\t\t\tdeviceName: deviceName,\n\t\t\t\t\t} as DeviceDiscoveryEvent);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 'devStatus': {\n\t\t\t\tconst sendingDevice = this.devices[remote.address];\n\t\t\t\tif (sendingDevice) {\n\t\t\t\t\tif (this.options.extendedLogging && !this.loggedDevices.includes(remote.address.toString())) {\n\t\t\t\t\t\tthis.options.logger?.info(`device status message data: ${JSON.stringify(messageObject)}`);\n\t\t\t\t\t\tthis.loggedDevices.push(remote.address.toString());\n\t\t\t\t\t}\n\t\t\t\t\tthis.emitDeviceStatusUpdate(sendingDevice, remote.address, messageObject);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdefault: {\n\t\t\t\tthis.options.logger?.debug(`message from: ${remote.address}:${remote.port} - ${message.toString()}`);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Send device status request to all known devices.\n\t */\n\tpublic refreshAllDevices(): void {\n\t\tfor (const ip in this.devices) {\n\t\t\tthis.requestDeviceStatus(ip);\n\t\t}\n\t}\n\n\t/**\n\t * Send device status request to a specific device.\n\t *\n\t * @param receiver The IP address or hostname of the device.\n\t */\n\tpublic requestDeviceStatus(receiver: string): void {\n\t\tconst requestDeviceStatusBuffer = Buffer.from(JSON.stringify(GoveeService.requestStatusMessage));\n\t\tthis.socket.send(\n\t\t\trequestDeviceStatusBuffer,\n\t\t\t0,\n\t\t\trequestDeviceStatusBuffer.length,\n\t\t\tGoveeService.CONTROL_PORT,\n\t\t\treceiver,\n\t\t);\n\t}\n\n\t/**\n\t * Send scan message to the UDP multicast address.\n\t */\n\tpublic sendScan(): void {\n\t\tthis.options.logger?.debug('sending scan message');\n\t\tconst scanMessageBuffer = Buffer.from(JSON.stringify(GoveeService.scanMessage));\n\t\tthis.socket.send(\n\t\t\tscanMessageBuffer,\n\t\t\t0,\n\t\t\tscanMessageBuffer.length,\n\t\t\tGoveeService.SEND_SCAN_PORT,\n\t\t\tGoveeService.M_CAST,\n\t\t);\n\t}\n\n\t/**\n\t * Add manual devices by IP address without discovery.\n\t * These devices will be added to the device list and can be controlled.\n\t *\n\t * @param ipAddresses Array of IP addresses to add as manual devices.\n\t */\n\tpublic addManualDevices(ipAddresses: string[]): void {\n\t\tfor (const ip of ipAddresses) {\n\t\t\tif (!ip || ip.trim().length === 0) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst trimmedIp = ip.trim();\n\n\t\t\t// Validate IP address format\n\t\t\tif (!isValidIpAddress(trimmedIp)) {\n\t\t\t\tthis.options.logger?.error(`Invalid IP address format: \"${trimmedIp}\" - skipping this entry`);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Generate a device name based on the IP address\n\t\t\tconst deviceName = `Manual_${trimmedIp.replace(/\\./g, '_')}`;\n\t\t\tthis.devices[trimmedIp] = deviceName;\n\t\t\tthis.options.logger?.info(`Added manual device: ${deviceName} at ${trimmedIp}`);\n\n\t\t\t// Emit discovery event for manual device\n\t\t\tthis.emit('deviceDiscovered', {\n\t\t\t\tip: trimmedIp,\n\t\t\t\tdeviceName: deviceName,\n\t\t\t} as DeviceDiscoveryEvent);\n\n\t\t\t// Request initial status\n\t\t\tthis.requestDeviceStatus(trimmedIp);\n\t\t}\n\t}\n\n\t/**\n\t * Stop all intervals and close the socket.\n\t */\n\tpublic stop(): void {\n\t\tif (this.searchInterval) {\n\t\t\tclearInterval(this.searchInterval);\n\t\t}\n\t\tif (this.refreshInterval) {\n\t\t\tclearInterval(this.refreshInterval);\n\t\t}\n\t\tthis.socket.close();\n\t}\n\n\t/**\n\t * Get all known devices.\n\t */\n\tpublic getDevices(): { [ip: string]: string } {\n\t\treturn this.devices;\n\t}\n\n\t/**\n\t * Handles a state change and sends the appropriate command to the device.\n\t *\n\t * @param id The state ID\n\t * @param state The new state object\n\t * @param receiver The device IP as string\n\t */\n\tpublic handleStateChange(id: string, state: ioBroker.State, receiver: string): void {\n\t\tconst stateKey = id.split('.')[4];\n\t\tswitch (stateKey) {\n\t\t\tcase 'onOff':\n\t\t\t\tthis.sendTurnCommand(receiver, !!state.val);\n\t\t\t\tbreak;\n\t\t\tcase 'brightness':\n\t\t\t\tthis.sendBrightnessCommand(receiver, Number(state.val));\n\t\t\t\tbreak;\n\t\t\tcase 'colorTemInKelvin':\n\t\t\t\tthis.sendColorTempCommand(receiver, Number(state.val));\n\t\t\t\tbreak;\n\t\t\tcase 'color': {\n\t\t\t\tconst colorValue = state.val?.toString();\n\t\t\t\tif (colorValue) {\n\t\t\t\t\tthis.sendColorCommand(receiver, colorValue);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\t/**\n\t * Send a turn on/off command to a device.\n\t *\n\t * @param receiver IP address or hostname\n\t * @param value true for on, false for off\n\t */\n\tpublic sendTurnCommand(receiver: string, value: boolean): void {\n\t\tconst turnMessage = { msg: { cmd: 'turn', data: { value: value ? 1 : 0 } } };\n\t\tconst turnMessageBuffer = Buffer.from(JSON.stringify(turnMessage));\n\t\tthis.socket.send(turnMessageBuffer, 0, turnMessageBuffer.length, GoveeService.CONTROL_PORT, receiver);\n\t}\n\n\t/**\n\t * Send a brightness command to a device.\n\t *\n\t * @param receiver IP address or hostname\n\t * @param value Brightness value\n\t */\n\tpublic sendBrightnessCommand(receiver: string, value: number): void {\n\t\tconst brightnessMessage = { msg: { cmd: 'brightness', data: { value } } };\n\t\tconst brightnessMessageBuffer = Buffer.from(JSON.stringify(brightnessMessage));\n\t\tthis.socket.send(\n\t\t\tbrightnessMessageBuffer,\n\t\t\t0,\n\t\t\tbrightnessMessageBuffer.length,\n\t\t\tGoveeService.CONTROL_PORT,\n\t\t\treceiver,\n\t\t);\n\t}\n\n\t/**\n\t * Send a color temperature command to a device.\n\t *\n\t * @param receiver IP address or hostname\n\t * @param kelvin Color temperature in Kelvin\n\t */\n\tpublic sendColorTempCommand(receiver: string, kelvin: number): void {\n\t\tconst colorTempMessageBuffer = Buffer.from(\n\t\t\tJSON.stringify({\n\t\t\t\tmsg: {\n\t\t\t\t\tcmd: 'colorwc',\n\t\t\t\t\tdata: { color: { r: 0, g: 0, b: 0 }, colorTemInKelvin: kelvin },\n\t\t\t\t},\n\t\t\t}),\n\t\t);\n\t\tthis.socket.send(colorTempMessageBuffer, 0, colorTempMessageBuffer.length, GoveeService.CONTROL_PORT, receiver);\n\t}\n\n\t/**\n\t * Send a color command to a device.\n\t *\n\t * @param receiver IP address or hostname\n\t * @param hexColor Color as hex string (e.g. #FFAABB)\n\t */\n\tpublic sendColorCommand(receiver: string, hexColor: string): void {\n\t\tconst rgb = hexToRgb(hexColor);\n\t\tconst colorMessage = { msg: { cmd: 'colorwc', data: { color: rgb } } };\n\t\tconst colorMessageBuffer = Buffer.from(JSON.stringify(colorMessage));\n\t\tthis.socket.send(colorMessageBuffer, 0, colorMessageBuffer.length, GoveeService.CONTROL_PORT, receiver);\n\t}\n\n\t/**\n\t * Emit device status update event with parsed status data.\n\t *\n\t * @param deviceName The device name.\n\t * @param ip The device IP address.\n\t * @param messageObject The parsed message object containing device status.\n\t */\n\tprivate emitDeviceStatusUpdate(deviceName: string, ip: string, messageObject: any): void {\n\t\tconst deviceData = messageObject.msg.data;\n\t\tconst colorString = `#${componentToHex(deviceData.color.r)}${componentToHex(deviceData.color.g)}${componentToHex(deviceData.color.b)}`;\n\n\t\tthis.emit('deviceStatusUpdate', {\n\t\t\tdeviceName: deviceName,\n\t\t\tip: ip,\n\t\t\tstatus: {\n\t\t\t\tonOff: deviceData.onOff === 1,\n\t\t\t\tbrightness: deviceData.brightness,\n\t\t\t\tcolor: colorString,\n\t\t\t\tcolorTemInKelvin: deviceData.colorTemInKelvin,\n\t\t\t},\n\t\t} as DeviceStatusEvent);\n\t}\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA,YAAuB;AACvB,yBAA6B;AAE7B,qBAAyC;AACzC,0BAAiC;AAiD1B,MAAM,qBAAqB,gCAAa;AAAA,EACtC;AAAA,EACA;AAAA,EACA,UAAoC,CAAC;AAAA,EACrC,gBAA0B,CAAC;A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,eAA0B;AACxF,UAAM,aAAa,cAAc,IAAI;AACrC,UAAM,cAAc,QAAI,+BAAe,WAAW,MAAM,CAAC,CAAC,OAAG,+BAAe,WAAW,MAAM,CAAC,CAAC,OAAG,+BAAe,WAAW,MAAM,CAAC,CAAC;AAEpI,SAAK,KAAK,sBAAsB;AAAA,MAC/B;AAAA,MACA;AAAA,MACA,QAAQ;AAAA,QACP,OAAO,WAAW,UAAU;AAAA,QAC5B,YAAY,WAAW;AAAA,QACvB,OAAO;AAAA,QACP,kBAAkB,WAAW;AAAA,MAC9B;AAAA,IACD,CAAsB;AAAA,EACvB;AACD;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/lib/goveeServiceOptions.ts"],
4
- "sourcesContent": ["/**\n * Configuration options for the GoveeService.\n */\nexport interface GoveeServiceOptions {\n\t/** Network interface to bind UDP socket to. */\n\tinterface: string;\n\t/** Interval in seconds for device search. */\n\tsearchInterval: number;\n\t/** Interval in seconds for device status refresh. */\n\tdeviceStatusRefreshInterval: number;\n\t/** Enable extended debug/info logging. */\n\textendedLogging?: boolean;\n\t/** RegExp for forbidden characters in device names. */\n\tforbiddenChars?: RegExp;\n\t/** Logger object with debug/info/error methods. */\n\tlogger?: { debug: (msg: string) => void; info: (msg: string) => void; error: (msg: string) => void };\n}\n"],
4
+ "sourcesContent": ["/**\n * Configuration options for the GoveeService.\n */\nexport interface GoveeServiceOptions {\n\t/** Network interface to bind UDP socket to. */\n\tinterface: string;\n\t/** Interval in seconds for device search. */\n\tsearchInterval: number;\n\t/** Interval in seconds for device status refresh. */\n\tdeviceStatusRefreshInterval: number;\n\t/** Enable extended debug/info logging. */\n\textendedLogging?: boolean;\n\t/** RegExp for forbidden characters in device names. */\n\tforbiddenChars?: RegExp;\n\t/** Logger object with debug/info/error methods. */\n\tlogger?: { debug: (msg: string) => void; info: (msg: string) => void; error: (msg: string) => void };\n\t/** Array of manual IP addresses for devices that should be added without discovery. */\n\tmanualIpAddresses?: string[];\n\t/** Disable automatic device discovery via multicast. */\n\tdisableAutoDiscovery?: boolean;\n}\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;",
6
6
  "names": []
7
7
  }
@@ -21,23 +21,23 @@ __export(datapointTools_exports, {
21
21
  getDatapointDescription: () => getDatapointDescription
22
22
  });
23
23
  module.exports = __toCommonJS(datapointTools_exports);
24
+ const datapointDescriptions = {
25
+ model: "Specific model of the Lamp",
26
+ ip: "IP address of the Lamp",
27
+ bleVersionHard: "Bluetooth Low Energy Hardware Version",
28
+ bleVersionSoft: "Bluetooth Low Energy Software Version",
29
+ wifiVersionHard: "WiFi Hardware Version",
30
+ wifiVersionSoft: "WiFi Software Version"
31
+ };
24
32
  function getDatapointDescription(name) {
25
- switch (name) {
26
- case "model":
27
- return "Specific model of the Lamp";
28
- case "ip":
29
- return "IP address of the Lamp";
30
- case "bleVersionHard":
31
- return "Bluetooth Low Energy Hardware Version";
32
- case "bleVersionSoft":
33
- return "Bluetooth Low Energy Software Version";
34
- case "wifiVersionHard":
35
- return "WiFi Hardware Version";
36
- case "wifiVersionSoft":
37
- return "WiFi Software Version";
38
- default:
39
- return "";
33
+ const desc = datapointDescriptions[name];
34
+ if (desc !== void 0) {
35
+ return desc;
36
+ }
37
+ if (false) {
38
+ console.debug(`[datapointTools] Unknown datapoint: ${name}`);
40
39
  }
40
+ return "";
41
41
  }
42
42
  // Annotate the CommonJS export names for ESM import in node:
43
43
  0 && (module.exports = {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/lib/tools/datapointTools.ts"],
4
- "sourcesContent": ["/**\n * Returns the description for device information datapoints.\n * This helps to keep the main adapter class clean and centralizes datapoint metadata.\n *\n * @param name The name of the parameter retrieved from the device\n * @returns The description to be set to the datapoint\n */\nexport function getDatapointDescription(name: string): string {\n\tswitch (name) {\n\t\tcase 'model':\n\t\t\treturn 'Specific model of the Lamp';\n\t\tcase 'ip':\n\t\t\treturn 'IP address of the Lamp';\n\t\tcase 'bleVersionHard':\n\t\t\treturn 'Bluetooth Low Energy Hardware Version';\n\t\tcase 'bleVersionSoft':\n\t\t\treturn 'Bluetooth Low Energy Software Version';\n\t\tcase 'wifiVersionHard':\n\t\t\treturn 'WiFi Hardware Version';\n\t\tcase 'wifiVersionSoft':\n\t\t\treturn 'WiFi Software Version';\n\t\tdefault:\n\t\t\treturn '';\n\t}\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAOO,SAAS,wBAAwB,MAAsB;AAC7D,UAAQ,MAAM;AAAA,IACb,KAAK;AACJ,aAAO;AAAA,IACR,KAAK;AACJ,aAAO;AAAA,IACR,KAAK;AACJ,aAAO;AAAA,IACR,KAAK;AACJ,aAAO;AAAA,IACR,KAAK;AACJ,aAAO;AAAA,IACR,KAAK;AACJ,aAAO;AAAA,IACR;AACC,aAAO;AAAA,EACT;AACD;",
4
+ "sourcesContent": ["/**\n * Returns the description for device information datapoints.\n * This helps to keep the main adapter class clean and centralizes datapoint metadata.\n *\n * @param name The name of the parameter retrieved from the device\n * @returns The description to be set to the datapoint\n */\nconst datapointDescriptions: Record<string, string> = {\n\tmodel: 'Specific model of the Lamp',\n\tip: 'IP address of the Lamp',\n\tbleVersionHard: 'Bluetooth Low Energy Hardware Version',\n\tbleVersionSoft: 'Bluetooth Low Energy Software Version',\n\twifiVersionHard: 'WiFi Hardware Version',\n\twifiVersionSoft: 'WiFi Software Version',\n};\n\n/**\n * Returns the description for device information datapoints.\n * This helps to keep the main adapter class clean and centralizes datapoint metadata.\n *\n * @param name The name of the parameter retrieved from the device\n * @returns The description to be set to the datapoint\n */\nexport function getDatapointDescription(name: string): string {\n\tconst desc = datapointDescriptions[name];\n\tif (desc !== undefined) {\n\t\treturn desc;\n\t}\n\tif (process.env.NODE_ENV !== 'production') {\n\t\tconsole.debug(`[datapointTools] Unknown datapoint: ${name}`);\n\t}\n\treturn '';\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA,MAAM,wBAAgD;AAAA,EACrD,OAAO;AAAA,EACP,IAAI;AAAA,EACJ,gBAAgB;AAAA,EAChB,gBAAgB;AAAA,EAChB,iBAAiB;AAAA,EACjB,iBAAiB;AAClB;AASO,SAAS,wBAAwB,MAAsB;AAC7D,QAAM,OAAO,sBAAsB,IAAI;AACvC,MAAI,SAAS,QAAW;AACvB,WAAO;AAAA,EACR;AACA,MAAI,OAAuC;AAC1C,YAAQ,MAAM,uCAAuC,IAAI,EAAE;AAAA,EAC5D;AACA,SAAO;AACR;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var ipValidation_exports = {};
20
+ __export(ipValidation_exports, {
21
+ filterValidIpAddresses: () => filterValidIpAddresses,
22
+ isValidIpAddress: () => isValidIpAddress,
23
+ validateIpAddresses: () => validateIpAddresses
24
+ });
25
+ module.exports = __toCommonJS(ipValidation_exports);
26
+ function isValidIpAddress(ip) {
27
+ const ipv4Pattern = /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;
28
+ return ipv4Pattern.test(ip);
29
+ }
30
+ function filterValidIpAddresses(ipAddresses, trimWhitespace = true) {
31
+ const validIps = [];
32
+ for (const ip of ipAddresses) {
33
+ if (!ip || trimWhitespace && ip.trim().length === 0) {
34
+ continue;
35
+ }
36
+ const processedIp = trimWhitespace ? ip.trim() : ip;
37
+ if (isValidIpAddress(processedIp)) {
38
+ validIps.push(processedIp);
39
+ }
40
+ }
41
+ return validIps;
42
+ }
43
+ function validateIpAddresses(ipAddresses, trimWhitespace = true) {
44
+ const valid = [];
45
+ const invalid = [];
46
+ for (const ip of ipAddresses) {
47
+ if (!ip || trimWhitespace && ip.trim().length === 0) {
48
+ continue;
49
+ }
50
+ const processedIp = trimWhitespace ? ip.trim() : ip;
51
+ if (isValidIpAddress(processedIp)) {
52
+ valid.push(processedIp);
53
+ } else {
54
+ invalid.push(processedIp);
55
+ }
56
+ }
57
+ return { valid, invalid };
58
+ }
59
+ // Annotate the CommonJS export names for ESM import in node:
60
+ 0 && (module.exports = {
61
+ filterValidIpAddresses,
62
+ isValidIpAddress,
63
+ validateIpAddresses
64
+ });
65
+ //# sourceMappingURL=ipValidation.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/lib/tools/ipValidation.ts"],
4
+ "sourcesContent": ["/**\n * Utility functions for IP address validation.\n */\n\n/**\n * Validates if a string is a valid IPv4 address.\n *\n * @param ip The IP address string to validate.\n * @returns true if valid IPv4 address, false otherwise.\n *\n * @example\n * ```typescript\n * isValidIpAddress('192.168.1.1'); // true\n * isValidIpAddress('255.255.255.255'); // true\n * isValidIpAddress('256.1.1.1'); // false\n * isValidIpAddress('not-an-ip'); // false\n * ```\n */\nexport function isValidIpAddress(ip: string): boolean {\n\t// IPv4 pattern: four octets (0-255) separated by dots\n\tconst ipv4Pattern =\n\t\t/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;\n\treturn ipv4Pattern.test(ip);\n}\n\n/**\n * Filters an array of IP addresses, returning only valid ones.\n * Invalid entries are skipped silently.\n *\n * @param ipAddresses Array of IP address strings to filter.\n * @param trimWhitespace If true, trims whitespace from each entry before validation (default: true).\n * @returns Array containing only valid IP addresses.\n *\n * @example\n * ```typescript\n * filterValidIpAddresses(['192.168.1.1', 'invalid', '10.0.0.1']); // ['192.168.1.1', '10.0.0.1']\n * filterValidIpAddresses([' 192.168.1.1 ', '']); // ['192.168.1.1']\n * ```\n */\nexport function filterValidIpAddresses(ipAddresses: string[], trimWhitespace = true): string[] {\n\tconst validIps: string[] = [];\n\n\tfor (const ip of ipAddresses) {\n\t\tif (!ip || (trimWhitespace && ip.trim().length === 0)) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst processedIp = trimWhitespace ? ip.trim() : ip;\n\n\t\tif (isValidIpAddress(processedIp)) {\n\t\t\tvalidIps.push(processedIp);\n\t\t}\n\t}\n\n\treturn validIps;\n}\n\n/**\n * Validates and sanitizes an array of IP addresses.\n * Returns an object with valid IPs and invalid entries.\n *\n * @param ipAddresses Array of IP address strings to validate.\n * @param trimWhitespace If true, trims whitespace from each entry before validation (default: true).\n * @returns Object containing arrays of valid and invalid IP addresses.\n *\n * @example\n * ```typescript\n * const result = validateIpAddresses(['192.168.1.1', 'invalid', '10.0.0.1']);\n * // result.valid: ['192.168.1.1', '10.0.0.1']\n * // result.invalid: ['invalid']\n * ```\n */\nexport function validateIpAddresses(\n\tipAddresses: string[],\n\ttrimWhitespace = true,\n): { valid: string[]; invalid: string[] } {\n\tconst valid: string[] = [];\n\tconst invalid: string[] = [];\n\n\tfor (const ip of ipAddresses) {\n\t\tif (!ip || (trimWhitespace && ip.trim().length === 0)) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst processedIp = trimWhitespace ? ip.trim() : ip;\n\n\t\tif (isValidIpAddress(processedIp)) {\n\t\t\tvalid.push(processedIp);\n\t\t} else {\n\t\t\tinvalid.push(processedIp);\n\t\t}\n\t}\n\n\treturn { valid, invalid };\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAkBO,SAAS,iBAAiB,IAAqB;AAErD,QAAM,cACL;AACD,SAAO,YAAY,KAAK,EAAE;AAC3B;AAgBO,SAAS,uBAAuB,aAAuB,iBAAiB,MAAgB;AAC9F,QAAM,WAAqB,CAAC;AAE5B,aAAW,MAAM,aAAa;AAC7B,QAAI,CAAC,MAAO,kBAAkB,GAAG,KAAK,EAAE,WAAW,GAAI;AACtD;AAAA,IACD;AAEA,UAAM,cAAc,iBAAiB,GAAG,KAAK,IAAI;AAEjD,QAAI,iBAAiB,WAAW,GAAG;AAClC,eAAS,KAAK,WAAW;AAAA,IAC1B;AAAA,EACD;AAEA,SAAO;AACR;AAiBO,SAAS,oBACf,aACA,iBAAiB,MACwB;AACzC,QAAM,QAAkB,CAAC;AACzB,QAAM,UAAoB,CAAC;AAE3B,aAAW,MAAM,aAAa;AAC7B,QAAI,CAAC,MAAO,kBAAkB,GAAG,KAAK,EAAE,WAAW,GAAI;AACtD;AAAA,IACD;AAEA,UAAM,cAAc,iBAAiB,GAAG,KAAK,IAAI;AAEjD,QAAI,iBAAiB,WAAW,GAAG;AAClC,YAAM,KAAK,WAAW;AAAA,IACvB,OAAO;AACN,cAAQ,KAAK,WAAW;AAAA,IACzB;AAAA,EACD;AAEA,SAAO,EAAE,OAAO,QAAQ;AACzB;",
6
+ "names": []
7
+ }
package/build/main.js CHANGED
@@ -34,9 +34,10 @@ module.exports = __toCommonJS(main_exports);
34
34
  var utils = __toESM(require("@iobroker/adapter-core"));
35
35
  var import_goveeService = require("./lib/goveeService");
36
36
  class GoveeLocal extends utils.Adapter {
37
+ /** Instance of GoveeService for device communication */
37
38
  goveeService;
38
39
  /**
39
- * Constructor of the adapter class.
40
+ * Adapter constructor. Registers lifecycle event handlers.
40
41
  *
41
42
  * @param options Optional adapter options to override defaults.
42
43
  */
@@ -50,7 +51,8 @@ class GoveeLocal extends utils.Adapter {
50
51
  this.on("unload", this.onUnload.bind(this));
51
52
  }
52
53
  /**
53
- * Is called when databases are connected and adapter received configuration.
54
+ * Called when databases are connected and adapter received configuration.
55
+ * Initializes GoveeService and sets up event listeners for device events.
54
56
  */
55
57
  async onReady() {
56
58
  void this.setObjectNotExists("info.connection", {
@@ -64,12 +66,26 @@ class GoveeLocal extends utils.Adapter {
64
66
  },
65
67
  native: {}
66
68
  });
69
+ void this.setObjectNotExists("info.discoveredDevices", {
70
+ type: "state",
71
+ common: {
72
+ name: "List of discovered devices",
73
+ type: "string",
74
+ role: "json",
75
+ read: true,
76
+ write: false,
77
+ desc: "JSON object with IP addresses and device names of all discovered devices"
78
+ },
79
+ native: {}
80
+ });
67
81
  this.goveeService = new import_goveeService.GoveeService({
68
82
  interface: this.config.interface,
69
83
  searchInterval: this.config.searchInterval,
70
84
  deviceStatusRefreshInterval: this.config.deviceStatusRefreshInterval,
71
85
  extendedLogging: this.config.extendedLogging,
72
86
  forbiddenChars: /[^a-zA-Z0-9_-]/g,
87
+ manualIpAddresses: this.config.manualIpTable,
88
+ disableAutoDiscovery: this.config.disableAutoDiscovery,
73
89
  logger: {
74
90
  debug: (msg) => this.log.debug(msg),
75
91
  info: (msg) => this.log.info(msg),
@@ -90,7 +106,8 @@ class GoveeLocal extends utils.Adapter {
90
106
  return Promise.resolve();
91
107
  }
92
108
  /**
93
- * Is called if a subscribed state changes
109
+ * Called if a subscribed state changes (e.g. user toggles a switch in ioBroker UI).
110
+ * Forwards the change to the GoveeService for device communication.
94
111
  *
95
112
  * @param id The ID of the changed state.
96
113
  * @param state The new state object or null/undefined.
@@ -109,7 +126,7 @@ class GoveeLocal extends utils.Adapter {
109
126
  return Promise.resolve();
110
127
  }
111
128
  /**
112
- * Called when adapter shuts down - callback must be called under any circumstances!
129
+ * Called when the adapter shuts down. Cleans up resources and stops services.
113
130
  *
114
131
  * @param callback Callback function after unload process.
115
132
  */
@@ -126,9 +143,16 @@ class GoveeLocal extends utils.Adapter {
126
143
  callback();
127
144
  }
128
145
  }
146
+ /**
147
+ * Updates a state only if the value has changed.
148
+ *
149
+ * @param fullName Full object path
150
+ * @param state New value
151
+ * @param acknowledged Whether the value is acknowledged (default: true)
152
+ */
129
153
  async updateStateAsync(fullName, state, acknowledged = true) {
130
154
  const currentState = await this.getStateAsync(fullName);
131
- if (currentState != state) {
155
+ if ((currentState == null ? void 0 : currentState.val) !== state) {
132
156
  void this.setState(fullName, {
133
157
  val: state,
134
158
  ack: acknowledged
@@ -136,7 +160,8 @@ class GoveeLocal extends utils.Adapter {
136
160
  }
137
161
  }
138
162
  /**
139
- * Handle device discovery event.
163
+ * Handles device discovery event from GoveeService.
164
+ * Creates all necessary objects and states for the new device.
140
165
  *
141
166
  * @param event The device discovery event data.
142
167
  */
@@ -176,9 +201,21 @@ class GoveeLocal extends utils.Adapter {
176
201
  native: {}
177
202
  });
178
203
  this.log.info(`Device discovered: ${deviceName} at ${ip}`);
204
+ await this.updateDiscoveredDevicesList();
205
+ }
206
+ /**
207
+ * Updates the info.discoveredDevices state with the current list of all discovered devices.
208
+ */
209
+ async updateDiscoveredDevicesList() {
210
+ const devices = this.goveeService.getDevices();
211
+ await this.setStateAsync("info.discoveredDevices", {
212
+ val: JSON.stringify(devices, null, 2),
213
+ ack: true
214
+ });
179
215
  }
180
216
  /**
181
- * Handle device status update event.
217
+ * Handles device status update event from GoveeService.
218
+ * Creates and updates all relevant states for the device.
182
219
  *
183
220
  * @param event The device status update event data.
184
221
  */
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';\n\n/**\n * The adapter class.\n */\nexport class GoveeLocal extends utils.Adapter {\n\tprivate goveeService!: GoveeService;\n\t/**\n\t * Constructor of the adapter class.\n\t *\n\t * @param options Optional adapter options to override defaults.\n\t */\n\tpublic constructor(options: Partial<utils.AdapterOptions> = {}) {\n\t\tsuper({\n\t\t\t...options,\n\t\t\tname: 'govee-local',\n\t\t});\n\t\tthis.on('ready', this.onReady.bind(this));\n\t\tthis.on('stateChange', this.onStateChange.bind(this));\n\t\t// this.on('objectChange', this.onObjectChange.bind(this));\n\t\t// this.on('message', this.onMessage.bind(this));\n\t\tthis.on('unload', this.onUnload.bind(this));\n\t}\n\n\t/**\n\t * Is called when databases are connected and adapter received configuration.\n\t */\n\tprivate async onReady(): Promise<void> {\n\t\tvoid this.setObjectNotExists('info.connection', {\n\t\t\ttype: 'state',\n\t\t\tcommon: {\n\t\t\t\tname: 'Device discovery running',\n\t\t\t\ttype: 'boolean',\n\t\t\t\trole: 'indicator.connected',\n\t\t\t\tread: true,\n\t\t\t\twrite: false,\n\t\t\t},\n\t\t\tnative: {},\n\t\t});\n\t\t// Initialize GoveeService with adapter config and logger\n\t\tthis.goveeService = new GoveeService({\n\t\t\tinterface: this.config.interface,\n\t\t\tsearchInterval: this.config.searchInterval,\n\t\t\tdeviceStatusRefreshInterval: this.config.deviceStatusRefreshInterval,\n\t\t\textendedLogging: this.config.extendedLogging,\n\t\t\tforbiddenChars: /[^a-zA-Z0-9_-]/g,\n\t\t\tlogger: {\n\t\t\t\tdebug: (msg) => this.log.debug(msg),\n\t\t\t\tinfo: (msg) => this.log.info(msg),\n\t\t\t\terror: (msg) => this.log.error(msg),\n\t\t\t},\n\t\t});\n\n\t\t// Set up event listeners\n\t\tthis.goveeService.on('deviceDiscovered', (data) => {\n\t\t\tvoid this.handleDeviceDiscovered(data);\n\t\t});\n\n\t\tthis.goveeService.on('deviceStatusUpdate', (data) => {\n\t\t\tvoid this.handleDeviceStatusUpdate(data);\n\t\t});\n\t\tthis.goveeService.start();\n\n\t\tif (this.config.extendedLogging) {\n\t\t\tthis.log.debug('running with extended logging');\n\t\t}\n\n\t\tvoid this.subscribeStates('*.devStatus.*');\n\t\treturn Promise.resolve();\n\t}\n\n\t/**\n\t * Is called if a subscribed state changes\n\t *\n\t * @param id The ID of the changed state.\n\t * @param state The new state object or null/undefined.\n\t */\n\tprivate async onStateChange(id: string, state: ioBroker.State | null | undefined): Promise<void> {\n\t\tif (state && !state.ack) {\n\t\t\tconst ipOfDevice = await this.getStateAsync(`${id.split('.')[2]}.deviceInfo.ip`);\n\t\t\tconst receiver = ipOfDevice?.val?.toString();\n\t\t\tif (typeof receiver === 'string') {\n\t\t\t\tthis.goveeService.handleStateChange(id, state, receiver);\n\t\t\t} else {\n\t\t\t\tthis.log.error('device not found or IP is not a string');\n\t\t\t}\n\t\t}\n\t\treturn Promise.resolve();\n\t}\n\t/**\n\t * Called when adapter shuts down - callback must be called under any circumstances!\n\t *\n\t * @param callback Callback function after unload process.\n\t */\n\tprivate onUnload(callback: () => void): void {\n\t\ttry {\n\t\t\tif (this.goveeService) {\n\t\t\t\tthis.goveeService.removeAllListeners();\n\t\t\t\tthis.goveeService.stop();\n\t\t\t}\n\t\t\tvoid this.updateStateAsync('info.connection', false);\n\t\t\tcallback();\n\t\t} catch (e: any) {\n\t\t\tthis.log.error(e.message);\n\t\t\tcallback();\n\t\t}\n\t}\n\n\tprivate async updateStateAsync(fullName: string, state: any, acknowledged = true): Promise<void> {\n\t\tconst currentState = await this.getStateAsync(fullName);\n\t\tif (currentState != state) {\n\t\t\tvoid this.setState(fullName, {\n\t\t\t\tval: state,\n\t\t\t\tack: acknowledged,\n\t\t\t});\n\t\t}\n\t}\n\n\t/**\n\t * Handle device discovery event.\n\t *\n\t * @param event The device discovery event data.\n\t */\n\tprivate async handleDeviceDiscovered(event: DeviceDiscoveryEvent): Promise<void> {\n\t\tconst { ip, deviceName } = event;\n\n\t\t// Create device folder\n\t\tawait this.setObjectNotExistsAsync(deviceName, {\n\t\t\ttype: 'folder',\n\t\t\tcommon: {\n\t\t\t\tname: deviceName,\n\t\t\t},\n\t\t\tnative: {},\n\t\t});\n\n\t\t// Create deviceInfo folder\n\t\tawait this.setObjectNotExistsAsync(`${deviceName}.deviceInfo`, {\n\t\t\ttype: 'folder',\n\t\t\tcommon: {\n\t\t\t\tname: 'Device Info',\n\t\t\t},\n\t\t\tnative: {},\n\t\t});\n\n\t\t// Create IP address state\n\t\tawait this.setObjectNotExistsAsync(`${deviceName}.deviceInfo.ip`, {\n\t\t\ttype: 'state',\n\t\t\tcommon: {\n\t\t\t\tname: 'IP address of the Lamp',\n\t\t\t\ttype: 'string',\n\t\t\t\trole: 'info.ip',\n\t\t\t\tread: true,\n\t\t\t\twrite: false,\n\t\t\t},\n\t\t\tnative: {},\n\t\t});\n\t\tawait this.updateStateAsync(`${deviceName}.deviceInfo.ip`, ip);\n\n\t\t// Create devStatus folder\n\t\tawait this.setObjectNotExistsAsync(`${deviceName}.devStatus`, {\n\t\t\ttype: 'folder',\n\t\t\tcommon: {\n\t\t\t\tname: 'Device Status',\n\t\t\t},\n\t\t\tnative: {},\n\t\t});\n\n\t\tthis.log.info(`Device discovered: ${deviceName} at ${ip}`);\n\t}\n\n\t/**\n\t * Handle device status update event.\n\t *\n\t * @param event The device status update event data.\n\t */\n\tprivate async handleDeviceStatusUpdate(event: DeviceStatusEvent): Promise<void> {\n\t\tconst { deviceName, status } = event;\n\n\t\t// Create and update onOff state\n\t\tawait this.setObjectNotExistsAsync(`${deviceName}.devStatus.onOff`, {\n\t\t\ttype: 'state',\n\t\t\tcommon: {\n\t\t\t\tname: 'On / Off state of the lamp',\n\t\t\t\ttype: 'boolean',\n\t\t\t\trole: 'switch',\n\t\t\t\tread: true,\n\t\t\t\twrite: true,\n\t\t\t},\n\t\t\tnative: {},\n\t\t});\n\t\tawait this.updateStateAsync(`${deviceName}.devStatus.onOff`, status.onOff);\n\n\t\t// Create and update brightness state\n\t\tawait this.setObjectNotExistsAsync(`${deviceName}.devStatus.brightness`, {\n\t\t\ttype: 'state',\n\t\t\tcommon: {\n\t\t\t\tname: 'Brightness of the light',\n\t\t\t\ttype: 'number',\n\t\t\t\trole: 'level.dimmer',\n\t\t\t\tread: true,\n\t\t\t\twrite: true,\n\t\t\t},\n\t\t\tnative: {},\n\t\t});\n\t\tawait this.updateStateAsync(`${deviceName}.devStatus.brightness`, status.brightness);\n\n\t\t// Create and update color state\n\t\tawait this.setObjectNotExistsAsync(`${deviceName}.devStatus.color`, {\n\t\t\ttype: 'state',\n\t\t\tcommon: {\n\t\t\t\tname: 'Current showing color of the lamp',\n\t\t\t\ttype: 'string',\n\t\t\t\trole: 'level.color.rgb',\n\t\t\t\tread: true,\n\t\t\t\twrite: true,\n\t\t\t},\n\t\t\tnative: {},\n\t\t});\n\t\tawait this.updateStateAsync(`${deviceName}.devStatus.color`, status.color);\n\n\t\t// Create and update color temperature state\n\t\tawait this.setObjectNotExistsAsync(`${deviceName}.devStatus.colorTemInKelvin`, {\n\t\t\ttype: 'state',\n\t\t\tcommon: {\n\t\t\t\tname: 'If staying in white light, the color temperature',\n\t\t\t\ttype: 'number',\n\t\t\t\trole: 'level.color.temperature',\n\t\t\t\tread: true,\n\t\t\t\twrite: true,\n\t\t\t},\n\t\t\tnative: {},\n\t\t});\n\t\tawait this.updateStateAsync(`${deviceName}.devStatus.colorTemInKelvin`, status.colorTemInKelvin);\n\t}\n}\n\nif (require.main !== module) {\n\t// Exportiere eine Factory-Funktion f\u00FCr ioBroker, aber die Klasse ist jetzt auch als ES6-Export verf\u00FCgbar\n\tmodule.exports = (options: Partial<utils.AdapterOptions> | undefined) => new GoveeLocal(options);\n} else {\n\t// otherwise start the instance directly\n\t(() => new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AO,KAAK;AAGzE,UAAM,KAAK,wBAAwB,GAAG,UAAU,yBAAyB;AAAA,MACxE,MAAM;AAAA,MACN,QAAQ;AAAA,QACP,MAAM;AAAA,QACN,MAAM;AAAA,QACN,MAAM;AAAA,QACN,MAAM;AAAA,QACN,OAAO;AAAA,MACR;AAAA,MACA,QAAQ,CAAC;AAAA,IACV,CAAC;AACD,UAAM,KAAK,iBAAiB,GAAG,UAAU,yBAAyB,OAAO,UAAU;AAGnF,UAAM,KAAK,wBAAwB,GAAG,UAAU,oBAAoB;AAAA,MACnE,MAAM;AAAA,MACN,QAAQ;AAAA,QACP,MAAM;AAAA,QACN,MAAM;AAAA,QACN,MAAM;AAAA,QACN,MAAM;AAAA,QACN,OAAO;AAAA,MACR;AAAA,MACA,QAAQ,CAAC;AAAA,IACV,CAAC;AACD,UAAM,KAAK,iBAAiB,GAAG,UAAU,oBAAoB,OAAO,KAAK;AAGzE,UAAM,KAAK,wBAAwB,GAAG,UAAU,+BAA+B;AAAA,MAC9E,MAAM;AAAA,MACN,QAAQ;AAAA,QACP,MAAM;AAAA,QACN,MAAM;AAAA,QACN,MAAM;AAAA,QACN,MAAM;AAAA,QACN,OAAO;AAAA,MACR;AAAA,MACA,QAAQ,CAAC;AAAA,IACV,CAAC;AACD,UAAM,KAAK,iBAAiB,GAAG,UAAU,+BAA+B,OAAO,gBAAgB;AAAA,EAChG;AACD;AAEA,IAAI,QAAQ,SAAS,QAAQ;AAE5B,SAAO,UAAU,CAAC,YAAuD,IAAI,WAAW,OAAO;AAChG,OAAO;AAEN,GAAC,MAAM,IAAI,WAAW,GAAG;AAC1B;",
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';\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\t/** Instance of GoveeService for device communication */\n\tprivate goveeService!: GoveeService;\n\t/**\n\t * Adapter constructor. Registers lifecycle event handlers.\n\t *\n\t * @param options Optional adapter options to override defaults.\n\t */\n\tpublic constructor(options: Partial<utils.AdapterOptions> = {}) {\n\t\tsuper({\n\t\t\t...options,\n\t\t\tname: 'govee-local',\n\t\t});\n\t\t// Register event handlers for adapter lifecycle\n\t\tthis.on('ready', this.onReady.bind(this));\n\t\tthis.on('stateChange', this.onStateChange.bind(this));\n\t\t// Uncomment if you want to handle object changes or messages:\n\t\t// this.on('objectChange', this.onObjectChange.bind(this));\n\t\t// this.on('message', this.onMessage.bind(this));\n\t\tthis.on('unload', this.onUnload.bind(this));\n\t}\n\n\t/**\n\t * Called when databases are connected and adapter received configuration.\n\t * Initializes GoveeService and sets up event listeners for device events.\n\t */\n\tprivate async onReady(): Promise<void> {\n\t\t// Create connection indicator state if it doesn't exist\n\t\tvoid this.setObjectNotExists('info.connection', {\n\t\t\ttype: 'state',\n\t\t\tcommon: {\n\t\t\t\tname: 'Device discovery running',\n\t\t\t\ttype: 'boolean',\n\t\t\t\trole: 'indicator.connected',\n\t\t\t\tread: true,\n\t\t\t\twrite: false,\n\t\t\t},\n\t\t\tnative: {},\n\t\t});\n\n\t\t// Create state for discovered devices\n\t\tvoid this.setObjectNotExists('info.discoveredDevices', {\n\t\t\ttype: 'state',\n\t\t\tcommon: {\n\t\t\t\tname: 'List of discovered devices',\n\t\t\t\ttype: 'string',\n\t\t\t\trole: 'json',\n\t\t\t\tread: true,\n\t\t\t\twrite: false,\n\t\t\t\tdesc: 'JSON object with IP addresses and device names of all discovered devices',\n\t\t\t},\n\t\t\tnative: {},\n\t\t});\n\n\t\t// Initialize GoveeService with adapter config and logger\n\t\tthis.goveeService = new GoveeService({\n\t\t\tinterface: this.config.interface,\n\t\t\tsearchInterval: this.config.searchInterval,\n\t\t\tdeviceStatusRefreshInterval: this.config.deviceStatusRefreshInterval,\n\t\t\textendedLogging: this.config.extendedLogging,\n\t\t\tforbiddenChars: /[^a-zA-Z0-9_-]/g,\n\t\t\tmanualIpAddresses: this.config.manualIpTable,\n\t\t\tdisableAutoDiscovery: this.config.disableAutoDiscovery,\n\t\t\tlogger: {\n\t\t\t\tdebug: (msg) => this.log.debug(msg),\n\t\t\t\tinfo: (msg) => this.log.info(msg),\n\t\t\t\terror: (msg) => this.log.error(msg),\n\t\t\t},\n\t\t});\n\n\t\t// Listen for device discovery and status update events\n\t\tthis.goveeService.on('deviceDiscovered', (data) => {\n\t\t\tvoid this.handleDeviceDiscovered(data);\n\t\t});\n\n\t\tthis.goveeService.on('deviceStatusUpdate', (data) => {\n\t\t\tvoid this.handleDeviceStatusUpdate(data);\n\t\t});\n\t\t// Start device discovery and status polling\n\t\tthis.goveeService.start();\n\n\t\tif (this.config.extendedLogging) {\n\t\t\tthis.log.debug('running with extended logging');\n\t\t}\n\n\t\t// Subscribe to all device status state changes\n\t\tvoid this.subscribeStates('*.devStatus.*');\n\t\treturn Promise.resolve();\n\t}\n\n\t/**\n\t * Called if a subscribed state changes (e.g. user toggles a switch in ioBroker UI).\n\t * Forwards the change to the GoveeService for device communication.\n\t *\n\t * @param id The ID of the changed state.\n\t * @param state The new state object or null/undefined.\n\t */\n\tprivate async onStateChange(id: string, state: ioBroker.State | null | undefined): Promise<void> {\n\t\tif (state && !state.ack) {\n\t\t\t// Extract device name from state ID and get its IP address\n\t\t\tconst ipOfDevice = await this.getStateAsync(`${id.split('.')[2]}.deviceInfo.ip`);\n\t\t\tconst receiver = ipOfDevice?.val?.toString();\n\t\t\tif (typeof receiver === 'string') {\n\t\t\t\t// Forward the state change to the GoveeService\n\t\t\t\tthis.goveeService.handleStateChange(id, state, receiver);\n\t\t\t} else {\n\t\t\t\tthis.log.error('device not found or IP is not a string');\n\t\t\t}\n\t\t}\n\t\treturn Promise.resolve();\n\t}\n\t/**\n\t * Called when the adapter shuts down. Cleans up resources and stops services.\n\t *\n\t * @param callback Callback function after unload process.\n\t */\n\tprivate onUnload(callback: () => void): void {\n\t\ttry {\n\t\t\tif (this.goveeService) {\n\t\t\t\tthis.goveeService.removeAllListeners();\n\t\t\t\tthis.goveeService.stop();\n\t\t\t}\n\t\t\t// Set connection state to false\n\t\t\tvoid this.updateStateAsync('info.connection', false);\n\t\t\tcallback();\n\t\t} catch (e: any) {\n\t\t\tthis.log.error(e.message);\n\t\t\tcallback();\n\t\t}\n\t}\n\n\t/**\n\t * Updates a state only if the value has changed.\n\t *\n\t * @param fullName Full object path\n\t * @param state New value\n\t * @param acknowledged Whether the value is acknowledged (default: true)\n\t */\n\tprivate async updateStateAsync(fullName: string, state: any, acknowledged = true): Promise<void> {\n\t\tconst currentState = await this.getStateAsync(fullName);\n\t\tif (currentState?.val !== state) {\n\t\t\tvoid this.setState(fullName, {\n\t\t\t\tval: state,\n\t\t\t\tack: acknowledged,\n\t\t\t});\n\t\t}\n\t}\n\n\t/**\n\t * Handles device discovery event from GoveeService.\n\t * Creates all necessary objects and states for the new device.\n\t *\n\t * @param event The device discovery event data.\n\t */\n\tprivate async handleDeviceDiscovered(event: DeviceDiscoveryEvent): Promise<void> {\n\t\tconst { ip, deviceName } = event;\n\n\t\t// Create device folder\n\t\tawait this.setObjectNotExistsAsync(deviceName, {\n\t\t\ttype: 'folder',\n\t\t\tcommon: {\n\t\t\t\tname: deviceName,\n\t\t\t},\n\t\t\tnative: {},\n\t\t});\n\n\t\t// Create deviceInfo folder\n\t\tawait this.setObjectNotExistsAsync(`${deviceName}.deviceInfo`, {\n\t\t\ttype: 'folder',\n\t\t\tcommon: {\n\t\t\t\tname: 'Device Info',\n\t\t\t},\n\t\t\tnative: {},\n\t\t});\n\n\t\t// Create IP address state\n\t\tawait this.setObjectNotExistsAsync(`${deviceName}.deviceInfo.ip`, {\n\t\t\ttype: 'state',\n\t\t\tcommon: {\n\t\t\t\tname: 'IP address of the Lamp',\n\t\t\t\ttype: 'string',\n\t\t\t\trole: 'info.ip',\n\t\t\t\tread: true,\n\t\t\t\twrite: false,\n\t\t\t},\n\t\t\tnative: {},\n\t\t});\n\t\tawait this.updateStateAsync(`${deviceName}.deviceInfo.ip`, ip);\n\n\t\t// Create devStatus folder\n\t\tawait this.setObjectNotExistsAsync(`${deviceName}.devStatus`, {\n\t\t\ttype: 'folder',\n\t\t\tcommon: {\n\t\t\t\tname: 'Device Status',\n\t\t\t},\n\t\t\tnative: {},\n\t\t});\n\n\t\tthis.log.info(`Device discovered: ${deviceName} at ${ip}`);\n\n\t\t// Update the list of discovered devices\n\t\tawait this.updateDiscoveredDevicesList();\n\t}\n\n\t/**\n\t * Updates the info.discoveredDevices state with the current list of all discovered devices.\n\t */\n\tprivate async updateDiscoveredDevicesList(): Promise<void> {\n\t\tconst devices = this.goveeService.getDevices();\n\t\tawait this.setStateAsync('info.discoveredDevices', {\n\t\t\tval: JSON.stringify(devices, null, 2),\n\t\t\tack: true,\n\t\t});\n\t}\n\n\t/**\n\t * Handles device status update event from GoveeService.\n\t * Creates and updates all relevant states for the device.\n\t *\n\t * @param event The device status update event data.\n\t */\n\tprivate async handleDeviceStatusUpdate(event: DeviceStatusEvent): Promise<void> {\n\t\tconst { deviceName, status } = event;\n\n\t\t// Create and update onOff state\n\t\tawait this.setObjectNotExistsAsync(`${deviceName}.devStatus.onOff`, {\n\t\t\ttype: 'state',\n\t\t\tcommon: {\n\t\t\t\tname: 'On / Off state of the lamp',\n\t\t\t\ttype: 'boolean',\n\t\t\t\trole: 'switch',\n\t\t\t\tread: true,\n\t\t\t\twrite: true,\n\t\t\t},\n\t\t\tnative: {},\n\t\t});\n\t\tawait this.updateStateAsync(`${deviceName}.devStatus.onOff`, status.onOff);\n\n\t\t// Create and update brightness state\n\t\tawait this.setObjectNotExistsAsync(`${deviceName}.devStatus.brightness`, {\n\t\t\ttype: 'state',\n\t\t\tcommon: {\n\t\t\t\tname: 'Brightness of the light',\n\t\t\t\ttype: 'number',\n\t\t\t\trole: 'level.dimmer',\n\t\t\t\tread: true,\n\t\t\t\twrite: true,\n\t\t\t},\n\t\t\tnative: {},\n\t\t});\n\t\tawait this.updateStateAsync(`${deviceName}.devStatus.brightness`, status.brightness);\n\n\t\t// Create and update color state\n\t\tawait this.setObjectNotExistsAsync(`${deviceName}.devStatus.color`, {\n\t\t\ttype: 'state',\n\t\t\tcommon: {\n\t\t\t\tname: 'Current showing color of the lamp',\n\t\t\t\ttype: 'string',\n\t\t\t\trole: 'level.color.rgb',\n\t\t\t\tread: true,\n\t\t\t\twrite: true,\n\t\t\t},\n\t\t\tnative: {},\n\t\t});\n\t\tawait this.updateStateAsync(`${deviceName}.devStatus.color`, status.color);\n\n\t\t// Create and update color temperature state\n\t\tawait this.setObjectNotExistsAsync(`${deviceName}.devStatus.colorTemInKelvin`, {\n\t\t\ttype: 'state',\n\t\t\tcommon: {\n\t\t\t\tname: 'If staying in white light, the color temperature',\n\t\t\t\ttype: 'number',\n\t\t\t\trole: 'level.color.temperature',\n\t\t\t\tread: true,\n\t\t\t\twrite: true,\n\t\t\t},\n\t\t\tnative: {},\n\t\t});\n\t\tawait this.updateStateAsync(`${deviceName}.devStatus.colorTemInKelvin`, status.colorTemInKelvin);\n\t}\n}\n\n// Export factory function for ioBroker or start instance directly\nif (require.main !== module) {\n\t// Export factory function for ioBroker, also available as ES6 export\n\tmodule.exports = (options: Partial<utils.AdapterOptions> | undefined) => new GoveeLocal(options);\n} else {\n\t// Otherwise start the instance directly\n\t(() => new GoveeLocal())();\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,YAAuB;AACvB,0BAAgF;AAMzE,MAAM,mBAAmB,MAAM,QAAQ;AAAA;AAAA,EAErC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMD,YAAY,UAAyC,CAAC,GAAG;AAC/D,UAAM;AAAA,MACL,GAAG;AAAA,MACH,MAAM;AAAA,IACP,CAAC;AAED,SAAK,GAAG,SAAS,KAAK,QAAQ,KAAK,IAAI,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,WAAW,GAAG;AAC1B;",
6
6
  "names": []
7
7
  }
package/io-package.json CHANGED
@@ -1,8 +1,21 @@
1
1
  {
2
2
  "common": {
3
3
  "name": "govee-local",
4
- "version": "0.3.1",
4
+ "version": "0.4.0",
5
5
  "news": {
6
+ "0.4.0": {
7
+ "en": "Updated translations for datapoint descriptions in all supported languages\nRefreshed and modernized the admin UI: clearer sections, manual IP address list, Windows hint, and option to disable auto-discovery\nPossibility to manually add devices via IP-Address and Option to disable auto discovery\nSave auto discovered devices in info datapoint and show in admin UI",
8
+ "de": "Aktualisierte Übersetzungen für Datapoint-Beschreibungen in allen unterstützten Sprachen\nErfrischt und modernisiert den Admin UI: klarere Abschnitte, manuelle IP-Adressenliste, Windows-Hinweis und Option, Auto-Entdeckung deaktivieren\nMöglichkeit, manuell Geräte über IP-Adresse und Option hinzuzufügen, um die automatische Entdeckung zu deaktivieren\nSpeichern Sie Auto entdeckte Geräte in Info-Datenpunkt und zeigen Sie in admin UI",
9
+ "ru": "Обновленные переводы для описания точек данных на всех поддерживаемых языках\nОбновленный и модернизированный пользовательский интерфейс администратора: более четкие разделы, ручной список IP-адресов, подсказка Windows и возможность отключения автоматического обнаружения\nВозможность вручную добавлять устройства через IP-адрес и опцию для отключения автоматического обнаружения\nСохранить автоматически обнаруженные устройства в точке данных info и показать в admin UI",
10
+ "pt": "Traduções atualizadas para descrições de pontos de dados em todos os idiomas suportados\nAtualizada e modernizada a interface de administração: seções mais claras, lista de endereços IP manuais, dica do Windows e opção para desativar a descoberta automática\nPossibilidade de adicionar dispositivos manualmente via endereço IP e opção para desativar a descoberta automática\nSalve os dispositivos auto descobertos no ponto de dados de informação e mostrar na interface de administração",
11
+ "nl": "Bijgewerkte vertalingen voor gegevenspuntenbeschrijvingen in alle ondersteunde talen\nVernieuwde en gemoderniseerde admin UI: duidelijkere secties, handmatige IP-adreslijst, Windows-hint en optie om auto-ontdekking uit te schakelen\nMogelijkheid om handmatig apparaten toe te voegen via IP-adres en optie om automatische ontdekking uit te schakelen\nOpslaan automatisch ontdekte apparaten in info datapoint en tonen in admin UI",
12
+ "fr": "Traductions actualisées pour les descriptions de points de données dans toutes les langues prises en charge\nRafraîchi et modernisé l'interface utilisateur admin: sections plus claires, liste d'adresses IP manuelle, conseils de Windows, et option pour désactiver la découverte automatique\nPossibilité d'ajouter manuellement des périphériques via IP-Adresse et Option pour désactiver la découverte automatique\nEnregistrer les périphériques découverts automatiquement dans info datapoint et afficher dans admin UI",
13
+ "it": "Traduzioni aggiornate per le descrizioni dei datapoint in tutte le lingue supportate\nAggiornato e modernizzato l'interfaccia utente di amministrazione: sezioni più chiare, elenco di indirizzi IP manuale, suggerimento di Windows e l'opzione per disabilitare l'auto-scoprimento\nPossibilità di aggiungere manualmente i dispositivi tramite IP-Address e Opzione per disabilitare la scoperta automatica\nSalvare i dispositivi auto scoperti in datapoint info e mostrare in admin UI",
14
+ "es": "Traducciones actualizadas para descripciones de puntos de datos en todos los idiomas compatibles\nActualizado y modernizado el administrador UI: secciones más claras, lista manual de direcciones IP, insinuación de Windows y opción para desactivar el auto-descubrimiento\nPosibilidad de añadir manualmente dispositivos a través de IP-Address y Option para desactivar el descubrimiento automático\nGuardar dispositivos auto descubiertos en info datapoint y mostrar en admin UI",
15
+ "pl": "Aktualizacja tłumaczeń opisów punktów danych we wszystkich obsługiwanych językach\nOdśwież i zmodernizuj interfejs administracyjny: jaśniejsze sekcje, ręczną listę adresów IP, podpowiedź systemu Windows oraz opcję wyłączenia autoodkrycia\nMożliwość ręcznego dodawania urządzeń poprzez adres IP- i opcja wyłączenia automatycznego wyszukiwania\nZapisz automatycznie odkryte urządzenia w info datapoint i pokaż w UI admin",
16
+ "uk": "Оновлено переклади для описів точок даних у всіх підтриманих мовах\nВідновлений і модернізований адміністратор UI: чіткі розділи, ручний IP-адресний список, підказка для Windows, і опція для вимкнення автоматично-розкриття\nМожливість вручну додати пристрої через IP-адресу та можливість вимкнути автоматичне відкриття\nЗаощаджуйте автовідкриті пристрої в інформаційній точці та покажете в адмін UI",
17
+ "zh-cn": "更新所有支持语言的数据点描述翻译\n更新和现代化管理 UI: 更清晰的段落、 手动 IP 地址列表、 Windows 提示和禁用自动发现选项\n通过 IP- Address和选项手动添加设备以禁用自动发现的可能性\n在信息数据点中保存自动发现的设备, 并在 admin UI 中显示"
18
+ },
6
19
  "0.3.1": {
7
20
  "en": "updated release script run configuration",
8
21
  "de": "aktualisierte versionsskriptlaufkonfiguration",
@@ -80,19 +93,6 @@
80
93
  "pl": "naprawić zmianę jasności również zmieniając biały tmperature",
81
94
  "uk": "зафіксувати яскравість зміни також змінюють білу мпературу",
82
95
  "zh-cn": "固定亮度改变, 也改变白色温度"
83
- },
84
- "0.2.5": {
85
- "en": "create only one socket, as the second seems not to be necessary\nrefactoring the code for better structure\npossibility to choose listen interface in settings",
86
- "de": "nur eine steckdose erstellen, da die zweite scheinbar nicht notwendig ist\nrefactoring des codes für bessere struktur\nmöglichkeit, die hörschnittstelle in einstellungen zu wählen",
87
- "ru": "создать только один розеток, так как второй кажется не нужным\nрефакторинг кода для лучшей структуры\nвозможность выбора интерфейса прослушивания в настройках",
88
- "pt": "criar apenas um soquete, como o segundo parece não ser necessário\nrefatorando o código para melhor estrutura\npossibilidade de escolher a interface de escuta em configurações",
89
- "nl": "maken slechts een socket, omdat de tweede lijkt niet nodig\nrefactoring van de code voor betere structuur\nmogelijkheid om luisterinterface in instellingen te kiezen",
90
- "fr": "créer une seule prise, car la seconde ne semble pas nécessaire\nrefactorer le code pour une meilleure structure\npossibilité de choisir l'interface d'écoute dans les paramètres",
91
- "it": "creare solo una presa, come il secondo sembra non essere necessario\nrefactoring il codice per una migliore struttura\npossibilità di scegliere l'interfaccia di ascolto nelle impostazioni",
92
- "es": "crear sólo una toma, ya que el segundo parece no ser necesario\nrefactorización del código para una mejor estructura\nposibilidad de elegir la interfaz de escucha en los ajustes",
93
- "pl": "utworzyć tylko jedno gniazdo, ponieważ drugie wydaje się nie być konieczne\nrefaktoring kodu dla lepszej struktury\nmożliwość wyboru interfejsu słuchania w ustawieniach",
94
- "uk": "створити тільки одну розетку, так як другий здається не потрібно\nрефакторинг коду для кращої структури\nможливість вибору інтерфейсу прослуховування в налаштуваннях",
95
- "zh-cn": "只创建一个套接字, 因为第二个似乎没有必要\n为更好的结构重构代码\n在设置中选择监听界面的可能性"
96
96
  }
97
97
  },
98
98
  "titleLang": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iobroker.govee-local",
3
- "version": "0.3.1",
3
+ "version": "0.4.0",
4
4
  "description": "Control Govee devices via local access (no cloud)",
5
5
  "author": {
6
6
  "name": "Børge Grunicke",
@@ -25,10 +25,10 @@
25
25
  "@iobroker/adapter-core": "^3.3.2"
26
26
  },
27
27
  "devDependencies": {
28
- "@alcalzone/release-script": "^3.8.0",
28
+ "@alcalzone/release-script": "^5.0.0",
29
29
  "@alcalzone/release-script-plugin-iobroker": "^3.7.2",
30
- "@alcalzone/release-script-plugin-license": "^3.7.0",
31
- "@alcalzone/release-script-plugin-manual-review": "^3.7.0",
30
+ "@alcalzone/release-script-plugin-license": "^4.0.0",
31
+ "@alcalzone/release-script-plugin-manual-review": "^4.0.0",
32
32
  "@iobroker/adapter-dev": "^1.4.0",
33
33
  "@iobroker/eslint-config": "^2.1.0",
34
34
  "@iobroker/testing": "^5.1.1",
@@ -42,10 +42,10 @@
42
42
  "@types/proxyquire": "^1.3.31",
43
43
  "@types/sinon": "^17.0.4",
44
44
  "@types/sinon-chai": "^3.2.12",
45
- "chai": "^6.0.1",
45
+ "chai": "^6.2.0",
46
46
  "chai-as-promised": "^8.0.2",
47
47
  "eslint": "^9.34.0",
48
- "mocha": "^11.7.1",
48
+ "mocha": "^11.7.4",
49
49
  "prettier": "^3.3.3",
50
50
  "proxyquire": "^2.1.3",
51
51
  "rimraf": "^6.0.1",