Skip to content

Commit

Permalink
fix UIID 182/190 power readings
Browse files Browse the repository at this point in the history
  • Loading branch information
bwp91 committed Mar 26, 2024
1 parent 9f0bef5 commit ec8bc4e
Show file tree
Hide file tree
Showing 6 changed files with 171 additions and 106 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ This project tries to adhere to [Semantic Versioning](http://semver.org/). In pr
- Bump `node` recommended versions to v18.19.1 or v20.11.1
- Updated dependencies

### Fixed

- Fix UIID 182/190 power readings

## 12.1.0 (2023-12-16)

### Added
Expand Down
3 changes: 2 additions & 1 deletion lib/device/outlet-single-inched.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ export default class {

switch (this.accessory.context.eweUIID) {
case 5:
case 182:
// Add Eve power characteristics
this.powerReadings = true;
if (!this.service.testCharacteristic(this.hapChar.OutletInUse)) {
Expand All @@ -90,6 +89,8 @@ export default class {
}
break;
case 32:
case 182:
case 190:
// Add Eve power characteristics
this.powerReadings = true;
if (!this.service.testCharacteristic(this.hapChar.OutletInUse)) {
Expand Down
11 changes: 5 additions & 6 deletions lib/device/outlet-single.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@ export default class {

switch (this.accessory.context.eweUIID) {
case 5:
case 182:
case 190:
// Add Eve power characteristics
this.powerReadings = true;
if (!this.service.testCharacteristic(this.hapChar.OutletInUse)) {
Expand All @@ -91,12 +89,10 @@ export default class {
if (this.service.testCharacteristic(this.eveChar.Voltage)) {
this.service.removeCharacteristic(this.service.getCharacteristic(this.eveChar.Voltage));
}

if (this.accessory.context.eweUIID === 190) {
this.divisor = 100;
}
break;
case 32:
case 182:
case 190:
// Add Eve power characteristics
this.powerReadings = true;
if (!this.service.testCharacteristic(this.hapChar.OutletInUse)) {
Expand All @@ -117,6 +113,9 @@ export default class {
if (!this.service.testCharacteristic(this.eveChar.ResetTotal)) {
this.service.addCharacteristic(this.eveChar.ResetTotal);
}
if (this.accessory.context.eweUIID === 190) {
this.divisor = 100;
}
break;
default:
// Remove unused Eve characteristics
Expand Down
4 changes: 2 additions & 2 deletions lib/device/switch-single-inched.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@ export default class {

switch (this.accessory.context.eweUIID) {
case 5:
case 182:
case 190:
// Add Eve power characteristics
this.powerReadings = true;
if (!this.service.testCharacteristic(this.hapChar.OutletInUse)) {
Expand All @@ -85,6 +83,8 @@ export default class {
}
break;
case 32:
case 182:
case 190:
// Add Eve power characteristics
this.powerReadings = true;
if (!this.service.testCharacteristic(this.hapChar.OutletInUse)) {
Expand Down
12 changes: 6 additions & 6 deletions lib/device/switch-single.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@ export default class {

switch (this.accessory.context.eweUIID) {
case 5:
case 182:
case 190:
// Add Eve power characteristics
this.powerReadings = true;
if (!this.service.testCharacteristic(this.hapChar.OutletInUse)) {
Expand All @@ -85,12 +83,10 @@ export default class {
if (this.service.testCharacteristic(this.eveChar.Voltage)) {
this.service.removeCharacteristic(this.service.getCharacteristic(this.eveChar.Voltage));
}

if (this.accessory.context.eweUIID === 190) {
this.divisor = 100;
}
break;
case 32:
case 182:
case 190:
// Add Eve power characteristics
this.powerReadings = true;
if (!this.service.testCharacteristic(this.hapChar.OutletInUse)) {
Expand All @@ -105,6 +101,10 @@ export default class {
if (!this.service.testCharacteristic(this.eveChar.Voltage)) {
this.service.addCharacteristic(this.eveChar.Voltage);
}

if (this.accessory.context.eweUIID === 190) {
this.divisor = 100;
}
break;
default:
// Remove unused Eve characteristics
Expand Down
Loading

0 comments on commit ec8bc4e

Please sign in to comment.