homebridge-lib 6.3.0 → 6.3.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.
|
@@ -125,7 +125,7 @@ class ContactValue extends HistoryValue {
|
|
|
125
125
|
})
|
|
126
126
|
parent.addCharacteristicDelegate({
|
|
127
127
|
key: 'resetTotal',
|
|
128
|
-
Characteristic:
|
|
128
|
+
Characteristic: parent.Characteristics.eve.ResetTotal
|
|
129
129
|
}).on('didSet', (value) => {
|
|
130
130
|
parent.timesOpenedDelegate.value = 0
|
|
131
131
|
})
|
|
@@ -162,6 +162,7 @@ class PowerValue extends HistoryValue {
|
|
|
162
162
|
constructor (parent, delegate) {
|
|
163
163
|
super(parent, delegate)
|
|
164
164
|
this._runningConsumption = 0 // 10-min-interval running value
|
|
165
|
+
this._totalConsumption = parent.computedConsumptionDelegate.value
|
|
165
166
|
this._power = delegate.value // current power
|
|
166
167
|
this._time = History.now() // start time of current power
|
|
167
168
|
delegate.on('didSet', (value) => {
|
|
@@ -174,7 +175,7 @@ class PowerValue extends HistoryValue {
|
|
|
174
175
|
})
|
|
175
176
|
parent.addCharacteristicDelegate({
|
|
176
177
|
key: 'resetTotal',
|
|
177
|
-
Characteristic:
|
|
178
|
+
Characteristic: parent.Characteristics.eve.ResetTotal
|
|
178
179
|
}).on('didSet', (value) => {
|
|
179
180
|
this._runningConsumption = 0
|
|
180
181
|
this._totalConsumption = 0
|
|
@@ -421,7 +422,7 @@ class History extends ServiceDelegate {
|
|
|
421
422
|
const valueType = new historyValueTypes[key](this, params[param])
|
|
422
423
|
fingerPrint.writeUInt8(valueType.tag, offset); offset++
|
|
423
424
|
fingerPrint.writeUInt8(valueType.length, offset); offset++
|
|
424
|
-
this._valueTypes.push(
|
|
425
|
+
this._valueTypes.push(valueType)
|
|
425
426
|
}
|
|
426
427
|
this.fingerPrint = fingerPrint.slice(0, offset)
|
|
427
428
|
this.debug('fingerPrint: 0x%s', this.fingerPrint.toString('hex').toUpperCase())
|