@evops/lightwaverf 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.dist/LightwaveAccount.js +2 -2
- package/.dist/integration.test.d.ts +1 -0
- package/.dist/integration.test.js +18 -0
- package/CHANGELOG.md +12 -0
- package/package.json +1 -1
|
@@ -70,7 +70,7 @@ class LightwaveAccount {
|
|
|
70
70
|
const devices = [];
|
|
71
71
|
for (var i = 0; i < home.rooms.length; i++) {
|
|
72
72
|
var r = home.rooms[i];
|
|
73
|
-
this.debug("Room " + r.name + " with " + r.devices
|
|
73
|
+
this.debug("Room " + r.name + " with " + r.devices?.length + " devices");
|
|
74
74
|
// Get device types
|
|
75
75
|
// O: On/Off Switch
|
|
76
76
|
// D: Dimmer
|
|
@@ -84,7 +84,7 @@ class LightwaveAccount {
|
|
|
84
84
|
deviceTypeMapping.set(1, LightwaveDevice_1.LightwaveDeviceType.OnOff);
|
|
85
85
|
deviceTypeMapping.set(2, LightwaveDevice_1.LightwaveDeviceType.Dimmer);
|
|
86
86
|
deviceTypeMapping.set(3, LightwaveDevice_1.LightwaveDeviceType.OnOff);
|
|
87
|
-
for (var j = 0; j < r.devices
|
|
87
|
+
for (var j = 0; j < r.devices?.length; j++) {
|
|
88
88
|
var d = r.devices[j];
|
|
89
89
|
const device = new LightwaveDevice_1.LightwaveDevice(this.mainDebug, r.room_number, d.device_number, r.name, d.name, deviceTypeMapping.get(d.device_type_id));
|
|
90
90
|
devices.push(device);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const vitest_1 = require("vitest");
|
|
7
|
+
const _1 = __importDefault(require("."));
|
|
8
|
+
const integratioTest = process.env.INTEGRATION ? vitest_1.describe : vitest_1.describe.skip;
|
|
9
|
+
integratioTest("integration", () => {
|
|
10
|
+
(0, vitest_1.it)("should correctly connect to LightwaveRF cloud", async () => {
|
|
11
|
+
const client = new _1.default({
|
|
12
|
+
email: process.env.LIGHTWAVERF_EMAIL,
|
|
13
|
+
pin: process.env.LIGHTWAVERF_PIN,
|
|
14
|
+
});
|
|
15
|
+
const devices = await client.getDevices();
|
|
16
|
+
(0, vitest_1.expect)(devices).toBeDefined();
|
|
17
|
+
});
|
|
18
|
+
});
|
package/CHANGELOG.md
CHANGED
|
@@ -5,24 +5,34 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [1.0.1] - 2025-11-11
|
|
9
|
+
|
|
10
|
+
#### Fixes
|
|
11
|
+
|
|
12
|
+
- Fix exception when parsing cloud account response when room has no devices in it
|
|
13
|
+
|
|
8
14
|
## [1.0.0] - 2025-11-09
|
|
9
15
|
|
|
10
16
|
### BREAKING CHANGES
|
|
11
17
|
|
|
12
18
|
#### Package Structure
|
|
19
|
+
|
|
13
20
|
- Changed output directory from `dist` to `.dist`
|
|
14
21
|
- Updated module exports to use new ES module format with explicit `types` and `default` fields
|
|
15
22
|
- Removed CommonJS `main` and `types` fields in favor of `exports` map
|
|
16
23
|
- Updated TypeScript target from older ECMAScript to ES2024
|
|
17
24
|
|
|
18
25
|
#### File Renames (Internal API)
|
|
26
|
+
|
|
19
27
|
- Renamed `LightwaveJsonMessageProcessor.ts` to `LightwaveMessageProcessorForJson.ts`
|
|
20
28
|
- Renamed `LightwaveTextMessageProcessor.ts` to `LightwaveMessageProcessorForText.ts`
|
|
21
29
|
|
|
22
30
|
#### Removed Features
|
|
31
|
+
|
|
23
32
|
- Removed `bin` directory and CLI executable
|
|
24
33
|
|
|
25
34
|
### Added
|
|
35
|
+
|
|
26
36
|
- Comprehensive test suite using Vitest
|
|
27
37
|
- Added test files: `LightwaveAccount.test.ts`, `LightwaveRFClient.test.ts`, `index.test.ts`
|
|
28
38
|
- Added test fixtures in `src/.fixtures/` for VCR-based HTTP testing
|
|
@@ -31,6 +41,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
31
41
|
- Modern build tooling with Vitest for testing
|
|
32
42
|
|
|
33
43
|
### Changed
|
|
44
|
+
|
|
34
45
|
- Complete TypeScript rewrite with improved type definitions
|
|
35
46
|
- Updated dependencies:
|
|
36
47
|
- Upgraded to modern lockfile format (lockfileVersion 3)
|
|
@@ -46,6 +57,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
46
57
|
- Improved `.gitignore` to include `.dist` directory
|
|
47
58
|
|
|
48
59
|
### Improved
|
|
60
|
+
|
|
49
61
|
- Better code organization with renamed message processor files
|
|
50
62
|
- Enhanced type safety throughout the codebase
|
|
51
63
|
- More maintainable project structure
|