Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new TV icon in iOS 14 #684

Open
wants to merge 162 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
162 commits
Select commit Hold shift + click to select a range
d13d17b
Working on TV accessory
AlexanderBabel Jan 31, 2019
71c27a9
Updated sample config
AlexanderBabel Jan 31, 2019
df910eb
Changed some characteristics
AlexanderBabel Jan 31, 2019
037e02a
Added input support for tv accessory
AlexanderBabel Feb 1, 2019
dc817d2
Updated sample config
AlexanderBabel Feb 1, 2019
a38c6b9
Bug fix
AlexanderBabel Mar 16, 2019
33ed301
Added persistence for inputs
AlexanderBabel Apr 21, 2019
f763522
Added support for multiple TVs
AlexanderBabel Apr 21, 2019
db65c66
Added version check
AlexanderBabel Apr 21, 2019
8ee67ef
Bug fix
AlexanderBabel Apr 21, 2019
7b605eb
Renamed project
AlexanderBabel Apr 21, 2019
3c5ce0f
Update aircon.js
kiwi-cam Aug 26, 2019
4f4405e
Update aircon.js
kiwi-cam Aug 27, 2019
7af7239
Update aircon.js
kiwi-cam Aug 27, 2019
fee4afc
Update package.json
kiwi-cam Aug 28, 2019
84d64fa
Update aircon.js
kiwi-cam Aug 28, 2019
bcdad07
Update aircon.js
kiwi-cam Aug 28, 2019
9dfa31a
Update package.json
kiwi-cam Sep 1, 2019
481467f
Update README.md
kiwi-cam Sep 1, 2019
e3b1428
Update README.md
kiwi-cam Sep 1, 2019
5b234c2
Update package.json
kiwi-cam Sep 2, 2019
8840043
Update README.md
kiwi-cam Sep 2, 2019
6fd6c77
Update checkForUpdates.js
kiwi-cam Sep 2, 2019
2580c81
Update package.json
kiwi-cam Sep 2, 2019
899d1cb
Update checkForUpdates.js
kiwi-cam Sep 2, 2019
2aacb59
Update package.json
kiwi-cam Sep 2, 2019
cc1e99b
Update package.json
kiwi-cam Sep 2, 2019
3d175c0
Update checkForUpdates.js
kiwi-cam Sep 2, 2019
7f85719
Create airconPro.js
kiwi-cam Sep 9, 2019
12c05af
Update package.json
kiwi-cam Sep 9, 2019
7bd8fb5
Update airconPro.js
kiwi-cam Sep 9, 2019
c6844d8
Update package.json
kiwi-cam Sep 9, 2019
9d36f4e
Delete airconPro.js
kiwi-cam Sep 9, 2019
1ed18a0
Update package.json
kiwi-cam Sep 9, 2019
b2c942f
Update aircon.js
kiwi-cam Sep 10, 2019
fbbaff3
Update package.json
kiwi-cam Sep 10, 2019
008c41c
Update aircon.js
kiwi-cam Sep 10, 2019
7ce7e47
Update package.json
kiwi-cam Sep 10, 2019
2e8723b
Update aircon.js
kiwi-cam Sep 10, 2019
391327e
Update package.json
kiwi-cam Sep 10, 2019
1acb7e9
Update aircon.js
kiwi-cam Sep 10, 2019
e3a60bd
Update package.json
kiwi-cam Sep 10, 2019
371852a
Update aircon.js
kiwi-cam Sep 10, 2019
7205498
Update aircon.js
kiwi-cam Sep 10, 2019
a2bfb86
Update package.json
kiwi-cam Sep 10, 2019
21943a3
Update aircon.js
kiwi-cam Sep 10, 2019
ffbe1c9
Update package.json
kiwi-cam Sep 10, 2019
d2f3db2
Update README.md
kiwi-cam Sep 10, 2019
d4c723d
Update README.md
kiwi-cam Sep 10, 2019
c69a63d
Update aircon.js
kiwi-cam Sep 10, 2019
d48f118
Merge pull request #1 from kiwi-cam/kiwi-cam-ACPro
kiwi-cam Sep 10, 2019
7c353d1
Update package.json
kiwi-cam Sep 10, 2019
7f30ecc
Update README.md
kiwi-cam Sep 10, 2019
988e226
Update README.md
kiwi-cam Sep 10, 2019
43f31ea
Update aircon.js
kiwi-cam Sep 10, 2019
a9882e5
Update package.json
kiwi-cam Sep 10, 2019
0aea09b
Update config-sample.json
kiwi-cam Sep 10, 2019
9c9ade4
Update README.md
kiwi-cam Sep 10, 2019
91322fb
Update aircon.js
kiwi-cam Sep 10, 2019
31f19e3
Update package.json
kiwi-cam Sep 10, 2019
792c956
Update aircon.js
kiwi-cam Sep 10, 2019
2f8bf38
Update package.json
kiwi-cam Sep 10, 2019
bcb742d
Update aircon.js
kiwi-cam Sep 10, 2019
3e5fd37
Update aircon.js
kiwi-cam Sep 10, 2019
6a2e55d
updateTemperatureFromFile rounding workaround
kiwi-cam Sep 19, 2019
085dd54
processQueuedTemperatureCallbacks rounding workaround
kiwi-cam Sep 19, 2019
7de6ddc
processQueuedTemperatureCallbacks rounding workaround
kiwi-cam Sep 19, 2019
8825d9a
Proper rounding/decimal fix
kiwi-cam Sep 19, 2019
a343173
Updated sendTemperature to process less when not required
kiwi-cam Sep 19, 2019
c18dd8f
Added W1 Device Support
kiwi-cam Sep 20, 2019
0c13ada
"w1DeviceID" config sample
kiwi-cam Sep 20, 2019
09d8c7c
W1 temperature fix
kiwi-cam Sep 20, 2019
28ae518
w1 Device Support
kiwi-cam Sep 20, 2019
8de635d
Added W1 information
kiwi-cam Sep 20, 2019
70aef39
W1 Error Handling
kiwi-cam Sep 20, 2019
0a99441
Improved Error handling in W1
kiwi-cam Sep 20, 2019
68a8f1c
Reduce error logging from w1
kiwi-cam Sep 20, 2019
3df25fc
Fixed rounding error
kiwi-cam Sep 20, 2019
150ac3b
Removed rounding - failed
kiwi-cam Sep 20, 2019
830fb68
w1Device fixed frequent updates
kiwi-cam Sep 20, 2019
f69b7be
Merge pull request #2 from kiwi-cam/w1Device
kiwi-cam Sep 20, 2019
5571d01
Added return 0 on w1 readerror
kiwi-cam Sep 20, 2019
584ce0d
Added logging on w1 read error
kiwi-cam Sep 20, 2019
4a79802
Improved w1 Error Handling
kiwi-cam Sep 21, 2019
56b0432
Add support for pingGrace parameter
RileyEv Sep 21, 2019
2e3b52d
Improved W1 and File reliability
kiwi-cam Sep 22, 2019
ca8bcdc
Merge pull request #3 from RileyEv/master
kiwi-cam Sep 22, 2019
aa9375c
Update tv.js
kiwi-cam Sep 22, 2019
55b0b33
Update tv.js
kiwi-cam Sep 22, 2019
8e9a846
Update package.json
kiwi-cam Sep 22, 2019
286dc15
Update package.json
kiwi-cam Sep 22, 2019
52eaff0
Update package.json
kiwi-cam Sep 23, 2019
c5f2a79
Update package.json
kiwi-cam Sep 23, 2019
4f293b4
Merge pull request #4 from kiwi-cam/TV-pingGrace
kiwi-cam Sep 23, 2019
c313740
Version increase for pingGrace support changes
kiwi-cam Sep 23, 2019
c5ccf4b
Update aircon.js
kiwi-cam Sep 23, 2019
6b7c812
Mode overwrite Temperature Fix
kiwi-cam Sep 24, 2019
5b47622
Code cleanup
kiwi-cam Sep 24, 2019
5fbc302
Added debugging
kiwi-cam Sep 24, 2019
b637949
Fixed replaceAutoMode bug
kiwi-cam Sep 24, 2019
b1ff4d7
Update aircon.js
kiwi-cam Sep 24, 2019
1557778
Added UI Refresh on mode change
kiwi-cam Sep 24, 2019
01535cf
setup pingTimeout to prevent device rediscovery
kiwi-cam Sep 24, 2019
f1e1905
pingTimeout to prevent device re-discovery
kiwi-cam Sep 24, 2019
70ef84e
rediscovery - pingTimeout
kiwi-cam Sep 24, 2019
e21c60b
Increased redicovery time
kiwi-cam Sep 24, 2019
ac4dd5d
Update getDevice.js
kiwi-cam Sep 24, 2019
b3acf72
Added Error check
kiwi-cam Sep 25, 2019
f6a05b8
Update getDevice.js
kiwi-cam Sep 25, 2019
13f0420
v1.2.5 with improved device comm reliability
kiwi-cam Sep 25, 2019
23e8778
Fixed hasModeChanged logic
kiwi-cam Sep 25, 2019
7cf2a72
Added multiple ping attempts before device inactive
kiwi-cam Sep 25, 2019
68951e8
Added logging of Mode changes
kiwi-cam Sep 25, 2019
f1b8f3c
Added sendHex on Mode only change
kiwi-cam Sep 25, 2019
f15bb3e
Fixed retry counter reset
kiwi-cam Sep 25, 2019
58a808b
Update getDevice.js
kiwi-cam Sep 25, 2019
e0b11f2
Update getDevice.js
kiwi-cam Sep 25, 2019
fe1f45a
Update getDevice.js
kiwi-cam Sep 25, 2019
605aea9
Tidied up logging and retry times
kiwi-cam Sep 25, 2019
5b43ab4
Fixed errors in ping retry logic
kiwi-cam Sep 25, 2019
0a2215c
Reduced ping retries to improve status reliability
kiwi-cam Sep 25, 2019
9f6e674
Update package.json
kiwi-cam Sep 25, 2019
5b5a88d
Merge pull request #5 from kiwi-cam/alpha-1
kiwi-cam Sep 25, 2019
a7b5176
Update package.json
kiwi-cam Sep 27, 2019
60d0d8f
Merge pull request #34 from AlexanderBabel/master
AlexanderBabel Sep 29, 2019
a51e37c
Merge pull request #30 from kiwi-cam/master
AlexanderBabel Sep 29, 2019
b8a1728
Adjusted readme, package.json and update checker
AlexanderBabel Sep 29, 2019
d2b14d5
Merge pull request #35 from AlexanderBabel/develop
AlexanderBabel Sep 29, 2019
6d74195
Update README.md
kiwi-cam Sep 30, 2019
f931546
Update README.md
kiwi-cam Sep 30, 2019
d177c69
Merge pull request #7 from AlexanderBabel/master
kiwi-cam Sep 30, 2019
d6b63e7
Fixed config formatting
kiwi-cam Sep 30, 2019
f7f5aef
Fixed unused mode hexcodes (#8)
kiwi-cam Oct 1, 2019
8540c0b
Fixed bug when no mode hexcodes set
kiwi-cam Oct 1, 2019
f937c8e
Typo
kiwi-cam Oct 1, 2019
edf2aa9
Mode hex fix (#9)
kiwi-cam Oct 1, 2019
9fc7f34
Updated README.md to include notes on new features (#10)
kiwi-cam Oct 1, 2019
1010dd5
Removed duplicate onTemperature Calls
kiwi-cam Oct 2, 2019
bd135d6
Reduced file and w1 temperature refresh frequency
kiwi-cam Oct 2, 2019
f3f1950
Documentation (#11)
kiwi-cam Oct 2, 2019
b05bd61
Mode Functionality Tidy-up (#36)
kiwi-cam Oct 3, 2019
66a216a
Updated README.md to include notes on new features
kiwi-cam Oct 3, 2019
2645cd9
Added mode and temp hexcode use details
kiwi-cam Oct 4, 2019
4c748d4
Fixed ignoreTemperatureWhenOff logic
kiwi-cam Oct 6, 2019
eb50ed0
Temperature Refresh optimisation
kiwi-cam Oct 6, 2019
08cb489
Merge branch 'master' into master
kiwi-cam Oct 7, 2019
15185e8
Increased temperature update frequency
kiwi-cam Oct 13, 2019
d63fb7f
Added w1 and file temperatureUpdateFrequency support
kiwi-cam Oct 14, 2019
a5c1412
Removed IO based limits from w1 devices
kiwi-cam Oct 15, 2019
9502b34
Improved ping error handling (#46)
kiwi-cam Nov 10, 2019
35b5812
Fix for bug checking temperature from device (#52)
kiwi-cam Nov 20, 2019
ed29edc
Added Error tag to discovery errors
kiwi-cam Nov 20, 2019
ab612ff
Retry when the device is offline (#59)
kiwi-cam Dec 12, 2019
8609344
Bug fix when falling back to 'classic mode' (#61)
kiwi-cam Dec 16, 2019
7a77ca3
Fixed Typo in TV message
kiwi-cam Jan 9, 2020
f1647f0
Kiwi cam mergetest (#69)
kiwi-cam Jan 29, 2020
51e3f37
Fixed bug in siri/automation temperature setting
kiwi-cam Feb 26, 2020
f7f93fc
Version increase for AC bug fix
kiwi-cam Feb 26, 2020
a77cd45
Adds RM Pro3 Support
dvcrn Apr 13, 2020
39372cd
Added note about fork with new device support
kiwi-cam May 25, 2020
38f34bd
Update README.md
AlexanderBabel Nov 13, 2020
ae59cbc
Update README.md
AlexanderBabel Nov 13, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
117 changes: 107 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,123 @@
# Homebridge Broadlink RM
# Homebridge Broadlink RM [TV+AC File Fork]

### Please use the fork of [kiwi-cam](https://github.com/kiwi-cam/homebridge-broadlink-rm). This fork is inactive due to not using this plugin anymore.

# About this fork

This fork adds support for the TV type indroduced in iOS 12.2. I'm only give support for this specific accessory type!

This fork also contains updates the to Air Conditioner accessory, as detailed in the documenation below.

If you want to use this fork, use this command:

`npm i -g homebridge-broadlink-rm-tv`

There's been a lot of work done on the main fork to support some newer Broadlink devices. I (kiwi-cam) have had trouble getting this fork updated to include this support. As a temporary resolution I've created a new fork homebridge-broadlink-rm-pro which adds new Broadlink device support (Thanks to @Defensor7). The new fork can be installed using:

`npm i -g homebridge-broadlink-rm-pro`

# Homebridge Broadlink RM [[Original](https://github.com/lprhodes/homebridge-broadlink-rm)]

## Introduction
Welcome to the Broadlink RM Mini and Broadlink RM Pro plugin for [Homebridge](https://github.com/nfarina/homebridge).

This plugin allows you to control your RM Mini and RM Pro with HomeKit using the Home app and Siri.

## Documentation

## Like this plugin?
Full documentation can be found [here](https://lprhodes.github.io/slate/). With the following additional configuration options available:

If you like this plugin and want to show your support then please star the Github repo, or better yet; buy me a drink using [Paypal](https://paypal.me/lprhodes) or [crypto currency](https://goo.gl/bEn1RW).
### Switch Accessory

Working on open source projects like this is full-time for me so every bit helps.
key | description | example | default
--- | ----------- | ------- | -------
pingGrace (optional) | Pauses ping status changes for the specified period (seconds) to allow device to start-up/shutdown after the change | 15 | 10

Thank you, sincerely!
### Aircon Accessory

## Newsletter
key | description | example | default
--- | ----------- | ------- | -------
w1DeviceID (optional) | Updates device current temperature from a Raspberry Pi Wire-1 thermometers (i.e. ds18b20). Value is the Device ID | 28-0321544e531ff |

You can keep informed about HomeKit, homebridge and homebridge plugins by subscribing to my [Works with](http://workswith.io) newsletter.
#### "data" key-value object
The device can be setup to manage modes in one of two ways. If your AC unit accepts a hexcade to change mode only (without temperature details) you can set the mode keys (heat/cool) and then the temperatureX values to change the teperature. If your AC unit sends hexcodes that contain the mode AND temperature you can use the modeX codes alone.

## Documentation
When the mode is changed the mode hexcodes are sent first - if set. Then the modeX code is sent to set the temperature, if it is set. If a matching modeX code can't be found, the temperatureX code is sent. If neither of these temperature codes are found either defaultHeatTemperature or defaultCoolTemperature codes will be used depending on if the target Temperature is higher or lower than the current temperature.

key | description
--- | -----------
off | A hex code string to be sent when the air conditioner is asked to be turned off.
temperatureX | A hex code string where X is any temperature you wish to support e.g. "temperature30".
modeX | A hex code string where X is any temperture, and mode is one of "heat","cool", or "auto". Hex code used to set unit to the specified mode and temperature

Full documentation can be found [here](https://lprhodes.github.io/slate/).
#### "temperatureX" and "modeX" key-value object

key | description
--- | -----------
data | Hex data stored as string.
pseudo-mode (optional) | The mode we set when this hex is sent. i.e. "heat" or "cool". For graphical purposes only (hence use of the term "pseudo"). Not recommended for ModeX key-values.

### TV Accessory

key | description | example | default
--- | ----------- | ------- | -------
enableAutoOff | Turn the TV off automatically when onDuration has been reached. | true | false
onDuration | The amount of time before the TV automatically turns itself off (used in conjunction with enableAutoOff). | 5 | 60
enableAutoOn | Turn the TV on automatically when offDuration has been reached | false | true
offDuration | The amount of time before the TV automatically turns itself on (used in conjunction with enableAutoOn). | 5 | 60
pingIPAddress | When an IP address is provided, it is pinged every second. If a response is received then the TV turns on, otherwise it turns off. | "192.167.1.77" |
pingIPAddressStateOnly | Using this option will prevent the hex code from being sent when the state changes | true | false
pingFrequency | The frequency in seconds that the IP address should be pinged | 5 | 1
pingGrace (optional) | Pauses ping status changes for the specified period (seconds) to allow device to start-up/shutdown after the change | 15 | 10
data | see below

#### "data" key-value object

key | description
--- | -----------
on | A hex code string to be sent when the tv is powered on.
off | A hex code string to be sent when the tv is powered off.
volume | see below
inputs | see below
remote | see below

#### "volume" key-value object
Configuration for volume changes via the Control Centre remote

key | description
--- | -----------
up | A hex code string to be sent to turn the TV volume up.
down | A hex code string to be sent to turn the TV volume down.

#### "inputs" key-value object
Inputs contain an array of the below settings, one for each input

key | description
--- | -----------
name | The name used for the mode, shown in the GUI.
type | One of the follow to represent the mode: 'other','home_screen','tuner','hdmi','composite_video','s_video','component_video','dvi','airplay','usb','application'
data | A hex code string to be sent to switch the TV to the selected input.

#### "remote" key-value object
Configuration of button options in the Control Centre remote

key | description
--- | -----------
rewind | The hex code for this button function
fastForward | The hex code for this button function
nextTrack | The hex code for this button function
previousTrack | The hex code for this button function
arrowUp | The hex code for this button function
arrowDown | The hex code for this button function
arrowLeft | The hex code for this button function
arrowRight | The hex code for this button function
select | The hex code for this button function
back | The hex code for this button function
exit | The hex code for this button function
playPause | The hex code for this button function
info | The hex code for this button function

## Thanks
Thanks to @tattn (https://github.com/tattn/homebridge-rm-mini3), @PJCzx (https://github.com/PJCzx/homebridge-thermostat) @momodalo (https://github.com/momodalo/broadlinkjs) whose time and effort got me started.
Original: Thanks to @tattn (https://github.com/tattn/homebridge-rm-mini3), @PJCzx (https://github.com/PJCzx/homebridge-thermostat) @momodalo (https://github.com/momodalo/broadlinkjs) whose time and effort got me started.

In this fork: Thanks to @kiwi-cam (https://github.com/kiwi-cam) and @Cloudore (https://github.com/Cloudore) for your work!
3 changes: 1 addition & 2 deletions accessories/accessory.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ class BroadlinkRMAccessory extends HomebridgeAccessory {
// Itterate through each hex config in the array
for (let index = 0; index < data.length; index++) {
const { pause } = data[index];

await this.performRepeatSend(data[index], actionCallback);

if (pause) {
Expand All @@ -65,7 +64,7 @@ class BroadlinkRMAccessory extends HomebridgeAccessory {
async performRepeatSend (parentData, actionCallback) {
const { host, log, name, debug } = this;
let { data, interval, sendCount } = parentData;

sendCount = sendCount || 1
if (sendCount > 1) interval = interval || 0.1;

Expand Down
144 changes: 144 additions & 0 deletions accessories/air-purifier.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
const ServiceManagerTypes = require('../helpers/serviceManagerTypes');

const FanAccessory = require('./fan');

class AirPurifierAccessory extends FanAccessory {

async setSwitchState (hexData, previousValue) {
super.setSwitchState(hexData, previousValue);

this.updateCurrentState()
}

// User requested a the target state be set
async setTargetState (hexData, previousValue) {
const { log, name, state, serviceManager } = this;

// Ignore if no change to the targetPosition
if (state.targetState === previousValue) return;

// Set the CurrentAirPurifierState to match the switch state
log(`${name} setTargetState: currently ${previousValue === 0 ? 'manual' : 'auto'}, changing to ${state.targetState === 0 ? 'manual' : 'auto'}`);

await this.performSend(hexData);
}

updateCurrentState() {
const { log, name, state, serviceManager } = this;

if (state.switchState === true) {
log(`${name} updateCurrentState: changing to purifying`);
state.currentState = Characteristic.CurrentAirPurifierState.PURIFYING_AIR

} else {
log(`${name} updateCurrentState: changing to idle`);
state.currentState = Characteristic.CurrentAirPurifierState.INACTIVE
}

serviceManager.refreshCharacteristicUI(Characteristic.CurrentAirPurifierState);
}

setupServiceManager () {
const { config, data, name, serviceManagerType } = this;
let {
showLockPhysicalControls,
showSwingMode,
showRotationDirection,
hideSwingMode,
hideRotationDirection
} = config;

const {
on,
off,
targetStateManual,
targetStateAuto,
lockControls,
unlockControls,
swingToggle
} = data || {};

// Defaults
if (showLockPhysicalControls !== false) showLockPhysicalControls = true
if (showSwingMode !== false && hideSwingMode !== true) showSwingMode = true
if (showRotationDirection !== false && hideRotationDirection !== true) showRotationDirection = true

this.serviceManager = new ServiceManagerTypes[serviceManagerType](name, Service.AirPurifier, this.log);

this.serviceManager.addToggleCharacteristic({
name: 'switchState',
type: Characteristic.On,
getMethod: this.getCharacteristicValue,
setMethod: this.setCharacteristicValue,
bind: this,
props: {
onData: on,
offData: off,
setValuePromise: this.setSwitchState.bind(this)
}
});

this.serviceManager.addToggleCharacteristic({
name: 'currentState',
type: Characteristic.CurrentAirPurifierState,
getMethod: this.getCharacteristicValue,
setMethod: this.setCharacteristicValue,
bind: this,
props: { }
});

this.serviceManager.addToggleCharacteristic({
name: 'targetState',
type: Characteristic.TargetAirPurifierState,
getMethod: this.getCharacteristicValue,
setMethod: this.setCharacteristicValue,
bind: this,
props: {
onData: targetStateManual,
offData: targetStateAuto,
setValuePromise: this.setTargetState.bind(this)
}
});

if (showLockPhysicalControls) {
this.serviceManager.addToggleCharacteristic({
name: 'lockPhysicalControls',
type: Characteristic.LockPhysicalControls,
getMethod: this.getCharacteristicValue,
setMethod: this.setCharacteristicValue,
bind: this,
props: {
onData: lockControls,
offData: unlockControls
}
});
}

if (showSwingMode) {
this.serviceManager.addToggleCharacteristic({
name: 'swingMode',
type: Characteristic.SwingMode,
getMethod: this.getCharacteristicValue,
setMethod: this.setCharacteristicValue,
bind: this,
props: {
onData: swingToggle,
offData: swingToggle,
}
});
}

this.serviceManager.addToggleCharacteristic({
name: 'fanSpeed',
type: Characteristic.RotationSpeed,
getMethod: this.getCharacteristicValue,
setMethod: this.setCharacteristicValue,
bind: this,
props: {
setValuePromise: this.setFanSpeed.bind(this)
}
});
}
}

module.exports = AirPurifierAccessory;
Loading