Skip to content

Commit

Permalink
Fix tests and some typos
Browse files Browse the repository at this point in the history
  • Loading branch information
itavero committed Jan 4, 2025
1 parent b6fe321 commit 3e2b9f2
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
6 changes: 5 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,9 @@
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
},
"cSpell.words": [
"Elgato",
"Zigbee"
]
}
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ Based on v1.9.2, as v1.9.3 was made later as a hotfix.

### Fixed

- Added additional checks to prevent certain errors from occuring during creation of a service handler. (see [#443](https://github.com/itavero/homebridge-z2m/issues/443))
- Added additional checks to prevent certain errors from occurring during creation of a service handler. (see [#443](https://github.com/itavero/homebridge-z2m/issues/443))
- Removed some default values from `config.schema.json` to prevent certain illegal configurations from being created by accident.

## [1.9.0] - 2022-06-29
Expand Down Expand Up @@ -461,7 +461,7 @@ For `cover` devices the following changes/fixes are in this release:

### Changed

- Restore BatteryServuce and WindowConvering properly on start up.
- Restore BatteryService and WindowCovering properly on start up.
- Improve state determination for WindowCovering.

[unreleased]: https://github.com/itavero/homebridge-z2m/compare/v1.11.0-beta.6...HEAD
Expand Down
16 changes: 10 additions & 6 deletions test/light.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ describe('Light', () => {
newHarness.checkCreationExpectations();
newHarness.checkHasMainCharacteristics();

newHarness.checkExpectedGetableKeys(['state', 'brightness', 'color_temp', 'color']);
newHarness.checkExpectedGetableKeys(['state', 'color_temp', 'color']);

// Expect range of color temperature to be configured
lightbulb.checkCharacteristicPropertiesHaveBeenSet('color_temp', {
Expand Down Expand Up @@ -507,7 +507,7 @@ describe('Light', () => {
newHarness.checkCreationExpectations();
newHarness.checkHasMainCharacteristics();

newHarness.checkExpectedGetableKeys(['state', 'brightness', 'color_temp', 'color']);
newHarness.checkExpectedGetableKeys(['state', 'color_temp', 'color']);

// Expect range of color temperature to be configured
lightbulb.checkCharacteristicPropertiesHaveBeenSet('color_temp', {
Expand Down Expand Up @@ -557,7 +557,7 @@ describe('Light', () => {
});
});

describe('Hue White Single bulb B22', () => {
describe('Hue White Single bulb B22 (allow request brightness)', () => {
// Shared "state"
let deviceExposes: ExposesEntry[] = [];
let harness: ServiceHandlersTestHarness;
Expand All @@ -571,6 +571,10 @@ describe('Light', () => {

// Check service creation
const newHarness = new ServiceHandlersTestHarness();

// Enable adaptive lighting to check if it will be ignored (as this device does not have a color temperature)
newHarness.addConverterConfiguration('light', { request_brightness: true });

newHarness
.getOrAddHandler(hap.Service.Lightbulb)
.addExpectedCharacteristic('state', hap.Characteristic.On, true)
Expand Down Expand Up @@ -687,7 +691,7 @@ describe('Light', () => {
newHarness.checkCreationExpectations();
newHarness.checkHasMainCharacteristics();

newHarness.checkExpectedGetableKeys(['state', 'brightness', 'color_temp', 'color']);
newHarness.checkExpectedGetableKeys(['state', 'color_temp', 'color']);

// Expect range of color temperature to be configured
lightbulb.checkCharacteristicPropertiesHaveBeenSet('color_temp', {
Expand Down Expand Up @@ -829,7 +833,7 @@ describe('Light', () => {
newHarness.checkCreationExpectations();
newHarness.checkHasMainCharacteristics();

newHarness.checkExpectedGetableKeys(['state', 'brightness']);
newHarness.checkExpectedGetableKeys(['state']);
harness = newHarness;
}

Expand Down Expand Up @@ -885,7 +889,7 @@ describe('Light', () => {
newHarness.checkCreationExpectations();
newHarness.checkHasMainCharacteristics();

newHarness.checkExpectedGetableKeys(['state', 'brightness', 'color_temp']);
newHarness.checkExpectedGetableKeys(['state', 'color_temp']);

// Expect range of color temperature to be configured
lightbulb.checkCharacteristicPropertiesHaveBeenSet('color_temp', {
Expand Down

0 comments on commit 3e2b9f2

Please sign in to comment.