Skip to content

Commit

Permalink
feat: Expose filter_age for IKEA E2007 (#5816)
Browse files Browse the repository at this point in the history
  • Loading branch information
sjorge authored May 31, 2023
1 parent 20920f9 commit 39a1928
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/devices/ikea.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,9 @@ const ikea = {
}

if (msg.data.hasOwnProperty('filterRunTime')) {
// Filter needs to be replaced after 6 months
// Filter needs to be replaced after 6 months
state['replace_filter'] = (parseInt(msg.data['filterRunTime']) >= 259200);
state['filter_age'] = parseInt(msg.data['filterRunTime']);
}

if (msg.data.hasOwnProperty('controlPanelLight')) {
Expand Down Expand Up @@ -353,7 +354,7 @@ const ikea = {
},
},
air_purifier_replace_filter: {
key: ['replace_filter'],
key: ['replace_filter', 'filter_age'],
convertGet: async (entity, key, meta) => {
await entity.read('manuSpecificIkeaAirPurifier', ['filterRunTime']);
},
Expand Down Expand Up @@ -1030,6 +1031,7 @@ module.exports = [
exposes.binary('child_lock', ea.ALL, 'LOCK', 'UNLOCK').withDescription('Enables/disables physical input on the device'),
exposes.binary('replace_filter', ea.STATE_GET, true, false)
.withDescription('Filter is older than 6 months and needs replacing'),
exposes.numeric('filter_age', ea.STATE_GET).withDescription('Time the filter has been used in minutes'),
],
meta: {fanStateOn: 'auto'},
fromZigbee: [ikea.fz.air_purifier],
Expand Down

0 comments on commit 39a1928

Please sign in to comment.