Skip to content

Commit b4d6f6a

Browse files
authored
Merge pull request #11 from sinricpro/dev-2.2.5
Dev 2.2.5
2 parents c29fc2a + 1043390 commit b4d6f6a

File tree

11 files changed

+730
-42
lines changed

11 files changed

+730
-42
lines changed

README.md

Lines changed: 53 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
# SinricPro (ESP8266 / ESP32 SDK)
3-
## Version 2.2.4
3+
## Version 2.2.5
44
## Installation
55

66
### VS Code & PlatformIO:
@@ -24,10 +24,11 @@
2424
## Examples
2525
|PlatformIO|Arduino|
2626
|:--:|:--:|
27-
|[Switch](https://github.com/sinricpro/esp8266-esp32-sdk/tree/master/pio-examples/switch) |[Switch](https://github.com/sinricpro/esp8266-esp32-sdk/tree/master/examples/Switch)|
28-
|[Doorbell](https://github.com/sinricpro/esp8266-esp32-sdk/tree/master/pio-examples/doorbell)|[Doorbell](https://github.com/sinricpro/esp8266-esp32-sdk/tree/master/examples/doorbell)|
29-
| - | [GarageDoorOpener](https://github.com/sinricpro/esp8266-esp32-sdk/tree/master/examples/GarageDoor)|
30-
|[TemperatureSensor](https://github.com/sinricpro/esp8266-esp32-sdk/tree/master/pio-examples/temperaturesensor) |[TemperatureSensor](https://github.com/sinricpro/esp8266-esp32-sdk/tree/master/examples/temperaturesensor)|
27+
| [Switch](https://github.com/sinricpro/esp8266-esp32-sdk/tree/master/pio-examples/switch) |[Switch](https://github.com/sinricpro/esp8266-esp32-sdk/tree/master/examples/Switch)|
28+
| [Doorbell](https://github.com/sinricpro/esp8266-esp32-sdk/tree/master/pio-examples/doorbell)|[Doorbell](https://github.com/sinricpro/esp8266-esp32-sdk/tree/master/examples/doorbell)|
29+
| - | [Lock](https://github.com/sinricpro/esp8266-esp32-sdk/tree/master/examples/GarageDoor)|
30+
| [TemperatureSensor](https://github.com/sinricpro/esp8266-esp32-sdk/tree/master/pio-examples/temperaturesensor) |[TemperatureSensor](https://github.com/sinricpro/esp8266-esp32-sdk/tree/master/examples/temperaturesensor)|
31+
| [TV](https://github.com/sinricpro/esp8266-esp32-sdk/tree/master/pio-examples/tv) | [TV](https://github.com/sinricpro/esp8266-esp32-sdk/tree/master/examples/tv)
3132

3233
---
3334

@@ -160,6 +161,7 @@ Defined in [SinricProTV.h](/src/SinricProTV.h)
160161
Callbacks
161162
- [onPowerState](#onpowerstate)
162163
- [onChangeChannel](#onchangechannel)
164+
- [onChangeChannelNumber](#onchangechannelnumber)
163165
- [onSkipChannels](#onskipchannels)
164166
- [onSelectInput](#onselectinput)
165167
- [onSetVolume](#onsetvolume)
@@ -448,6 +450,21 @@ Devices: | [TV](#tv) |
448450

449451
---
450452

453+
### onChangeChannelNumber
454+
```C++
455+
bool onChangeChannelNumber(const String &deviceId, int channelNumber, String &channelName)
456+
```
457+
| parameter | type| input value | output value | example |
458+
|--|--|--|--|-- |
459+
| `deviceId` | `const String&` | `deviceId` | --- | `"5d8f5ade41307b450335925d"` |
460+
| `channelNumber` | `int` | `0..n` | --- | `4` |
461+
|`channelName` | `String&` | --- | `channel name` | `"HBO"` (name of a tv channel) |
462+
| `[return]`| `bool` | --- | `true`: request handled properly<br>`false`: error | `true` |
463+
464+
Devices: | [TV](#tv) |
465+
466+
---
467+
451468
### onColor
452469
```C++
453470
bool onColor(const String &deviceId, byte &r, byte &g, byte &b)
@@ -723,19 +740,21 @@ bool sendBandsEvent(String bands, int level, String cause = "PHYSICAL_INTERACTIO
723740
| `bands` | `String` | selected band | `"BASS"`, `"MIDRANGE"`,`"TREBBLE"` |
724741
| `level` | `int` | report new band level | `0`..`n` |
725742
| `cause` | `String` | (optional) describing why this is event ocours | `"PHYSICAL_INTERACTION"` |
743+
| [return] | `bool` | `true` = event was sent, `false` event was not sent | `true` , `false` |
726744

727745
Devices: | [Speaker](#speaker) |
728746

729747
---
730748

731749
### sendBrightnessEvent
732750
```C++
733-
void sendBrightnessEvent(int brightness, String cause = "PHYSICAL_INTERACTION")
751+
bool sendBrightnessEvent(int brightness, String cause = "PHYSICAL_INTERACTION")
734752
```
735753
| parameter| type | description | value |
736754
|--|--|--|:--:|
737755
| `brightness` | `int` | brightness level | `0`..`100`|
738756
| `cause` | `String` | (optional) describing why this is event ocours | `"PHYSICAL_INTERACTION"` |
757+
| [return] | `bool` | `true` = event was sent, `false` event was not sent | `true` , `false` |
739758
740759
Devices: | [Light](#light) |
741760
@@ -749,59 +768,64 @@ bool sendChangeChannelEvent(String channelName, String cause = "PHYSICAL_INTERAC
749768
|--|--|--|:--:|
750769
| `channelName` | `String` | report new channel | example: `"HBO"` |
751770
| `cause` | `String` | (optional) describing why this is event ocours | `"PHYSICAL_INTERACTION"` |
771+
| [return] | `bool` | `true` = event was sent, `false` event was not sent | `true` , `false` |
752772

753773
Devices: | [TV](#tv) |
754774

755775
---
756776

757777
### sendColorEvent
758778
```C++
759-
void sendColorEvent(byte r, byte g, byte b, String cause = "PHYSICAL_INTERACTION")
779+
bool sendColorEvent(byte r, byte g, byte b, String cause = "PHYSICAL_INTERACTION")
760780
```
761781
| parameter| type | description | value |
762782
|--|--|--|:--:|
763783
| `r` | `byte` | red value | `0`..`255` |
764784
| `g` | `byte` | green value | `0`..`255` |
765785
| `b` | `byte` | blue value | `0`..`255` |
766786
| `cause` | `String` | (optional) describing why this is event ocours | `"PHYSICAL_INTERACTION"` |
787+
| [return] | `bool` | `true` = event was sent, `false` event was not sent | `true` , `false` |
767788
768789
Devices: | [Light](#light) |
769790
770791
---
771792
772793
### sendColorTemperatureEvent
773794
```C++
774-
void sendColorTemperatureEvent(int colorTemperature, String cause = "PHYSICAL_INTERACTION")
795+
bool sendColorTemperatureEvent(int colorTemperature, String cause = "PHYSICAL_INTERACTION")
775796
```
776797
| parameter| type | description | value |
777798
|--|--|--|:--:|
778799
| `colorTemperature` | `int` | color temperature | `2200`, `2700`, `4000`, `5500`, `7000` |
779800
| `cause` | `String` | (optional) describing why this is event ocours | `"PHYSICAL_INTERACTION"` |
801+
| [return] | `bool` | `true` = event was sent, `false` event was not sent | `true` , `false` |
780802

781803
Devices: | [Light](#light) |
782804

783805
---
784806

785807
### sendContactEvent
786808
```C++
787-
void sendContactEvent(bool detected, String cause = "PHYSICAL_INTERACTION")
809+
bool sendContactEvent(bool detected, String cause = "PHYSICAL_INTERACTION")
788810
```
789811
| parameter| type | description | value |
790812
|--|--|--|:--:|
791813
| `detected` | `bool` | report contact state | `true`: contact is closed<br>`false`: contact is open |
792814
| `cause` | `String` | (optional) describing why this is event ocours | `"PHYSICAL_INTERACTION"` |
815+
| [return] | `bool` | `true` = event was sent, `false` event was not sent | `true` , `false` |
793816
794817
Devices: | [ContactSensor](#contactsensor) |
795818
796819
---
797820
798821
### sendDoorbellEvent
799822
```C++
800-
void sendDoorbellEvent(String cause = "PHYSICAL_INTERACTION")
823+
bool sendDoorbellEvent(String cause = "PHYSICAL_INTERACTION")
801824
```
802825
| parameter| type | description | value |
803826
|--|--|--|:--:|
804827
| `cause` | `String` | (optional) describing why this is event ocours | `"PHYSICAL_INTERACTION"` |
828+
| [return] | `bool` | `true` = event was sent, `false` event was not sent | `true` , `false` |
805829

806830
Devices: | [Doorbell](#doorbell) |
807831

@@ -815,6 +839,7 @@ bool sendMediaControlEvent(String mediaControl, String cause = "PHYSICAL_INTERAC
815839
|--|--|--|:--:|
816840
| `mediaControl` | `String` | report a media event | `"Play"`, `"Pause"`, `"Stop"`, `"StartOver"`, `"Previous"`, `"Next"`, `"Rewind"`, `"FastForward"` |
817841
| `cause` | `String` | (optional) describing why this is event ocours | `"PHYSICAL_INTERACTION"` |
842+
| [return] | `bool` | `true` = event was sent, `false` event was not sent | `true` , `false` |
818843
819844
Devices: | [TV](#tv) | [Speaker](#speaker) |
820845
@@ -828,19 +853,21 @@ bool sendModeEvent(String mode, String cause = "PHYSICAL_INTERACTION")
828853
|--|--|--|:--:|
829854
| `mode` | `String` | report new mode | `"MOVIE"`, `"MUSIC"`, `"NIGHT"`, `"SPORT"`, `"TV"` |
830855
| `cause` | `String` | (optional) describing why this is event ocours | `"PHYSICAL_INTERACTION"` |
856+
| [return] | `bool` | `true` = event was sent, `false` event was not sent | `true` , `false` |
831857

832858
Devices: | [Speaker](#speaker) |
833859

834860
---
835861

836862
### sendMotionEvent
837863
```C++
838-
void sendMotionEvent(bool detected, String cause = "PHYSICAL_INTERACTION")
864+
bool sendMotionEvent(bool detected, String cause = "PHYSICAL_INTERACTION")
839865
```
840866
| parameter| type | description | value |
841867
|--|--|--|:--:|
842868
| `detected` | `bool` | report motion event | `true`: motion detected<br>`false`: motion not detected (should be sent if motion not happens any longer) |
843869
| `cause` | `String` | (optional) describing why this is event ocours | `"PHYSICAL_INTERACTION"` |
870+
| [return] | `bool` | `true` = event was sent, `false` event was not sent | `true` , `false` |
844871
845872
Devices: | [MotionSensor](#motionsensor) |
846873
@@ -854,34 +881,38 @@ bool sendMuteEvent(bool mute, String cause = "PHYSICAL_INTERACTION")
854881
|--|--|--|:--:|
855882
| `mute` | `bool` | report mute event | `true`: device is muted <br>`false`: device is unmuted |
856883
| `cause` | `String` | (optional) describing why this is event ocours | `"PHYSICAL_INTERACTION"` |
884+
| [return] | `bool` | `true` = event was sent, `false` event was not sent | `true` , `false` |
857885

858886
Devices: | [TV](#tv) | [Speaker](#speaker) |
859887

860888
---
861889

862890
### sendPowerLevelEvent
863891
```C++
864-
sendPowerLevelEvent(int level, String cause="PHYSICAL_INTERACTION")
892+
bool sendPowerLevelEvent(int level, String cause="PHYSICAL_INTERACTION")
865893
```
866894
| parameter| type | description | value |
867895
|--|--|--|:--:|
868896
| `level` | `int` | device power level | `0`..`100`|
869897
| `cause` | `String` | (optional) describing why this is event ocours | `"PHYSICAL_INTERACTION"` |
898+
| [return] | `bool` | `true` = event was sent, `false` event was not sent | `true` , `false` |
870899
871900
Devices: | [Dimmable Switch](#dimmable-switch) | [Fan (non US)](#fan-non-us) |
872901
873902
---
874903
875904
### sendPowerStateEvent
876905
```C++
877-
sendPowerStateEvent(bool state, String cause="PHYSICAL_INTERACTION")
906+
bool sendPowerStateEvent(bool state, String cause="PHYSICAL_INTERACTION")
878907
```
879908
| parameter| type | description | value |
880909
|--|--|--|--|
881910
| `state` | `bool` | device state |`true`: device is on<br>`false`: device is off |
882911
| `cause` | `String` | (optional) describing why this is event ocours | `"PHYSICAL_INTERACTION"`
912+
| [return] | `bool` | `true` = event was sent, `false` event was not sent | `true` , `false` |
883913

884914
Devices: | [Switch](#switch) | [Dimmable Switch](#dimmable-switch) | [Light](#light) | [TV](#tv) | [Speaker](#speaker) | [Temperaturesensor](#temperaturesensor) | [Thermostat](#thermostat) | [MotionSensor](#motionsensor) | [ContactSensor](#contactsensor) | [Fan (non US)](#fan-non-us) | [Fan (US)](#fan-us) |
915+
| [return] | `bool` | `true` = event was sent, `false` event was not sent | `true` , `false` |
885916

886917
---
887918

@@ -893,6 +924,7 @@ bool sendRangeValueEvent(int rangeValue, String cause = "PHYSICAL_INTERACTION")
893924
|--|--|--|:--:|
894925
| `rangeValue` | `int` | report actual range value | `0`..`n` |
895926
| `cause` | `String` | (optional) describing why this is event ocours | `"PHYSICAL_INTERACTION"` |
927+
| [return] | `bool` | `true` = event was sent, `false` event was not sent | `true` , `false` |
896928
897929
Devices: | [Fan (US)](#fan-us) | [Window AC Unit](#window-ac-unit) |
898930
@@ -906,46 +938,50 @@ bool sendSelectInputEvent(String intput, String cause = "PHYSICAL_INTERACTION")
906938
|--|--|--|:--:|
907939
| `input` | `String` | report actual input | `"AUX 1"`, `"AUX 2"`, `"AUX 3"`, `"AUX 4"`, `"AUX 5"`, `"AUX 6"`, `"AUX 7"`, `"BLURAY"`, `"CABLE"`, `"CD"`, `"COAX 1"`,`"COAX 2"`, `"COMPOSITE 1"`, `"DVD"`, `"GAME"`, `"HD RADIO"`, `"HDMI 1"`, `"HDMI 2"`, `"HDMI 3"`, `"HDMI 4"`, `"HDMI 5"`, `"HDMI 6"`, `"HDMI 7"`, `"HDMI 8"`, `"HDMI 9"`, `"HDMI 10"`, `"HDMI ARC"`, `"INPUT 1"`, `"INPUT 2"`, `"INPUT 3"`, `"INPUT 4"`, `"INPUT 5"`, `"INPUT 6"`, `"INPUT 7"`, `"INPUT 8"`, `"INPUT 9"`, `"INPUT 10"`, `"IPOD"`, `"LINE 1"`, `"LINE 2"`, `"LINE 3"`, `"LINE 4"`, `"LINE 5"`, `"LINE 6"`, `"LINE 7"`, `"MEDIA PLAYER"`, `"OPTICAL 1"`, `"OPTICAL 2"`, `"PHONO"`, `"PLAYSTATION"`, `"PLAYSTATION 3"`, `"PLAYSTATION 4"`, `"SATELLITE"`, `"SMARTCAST"`, `"TUNER"`, `"TV"`, `"USB DAC"`, `"VIDEO 1"`, `"VIDEO 2"`, `"VIDEO 3"`, `"XBOX"` |
908940
| `cause` | `String` | (optional) describing why this is event ocours | `"PHYSICAL_INTERACTION"` |
941+
| [return] | `bool` | `true` = event was sent, `false` event was not sent | `true` , `false` |
909942

910943
Devices: | [TV](#tv) |
911944

912945
---
913946

914947
### sendTargetTemperatureEvent
915948
```C++
916-
void sendTargetTemperatureEvent(float temperature, String cause = "PHYSICAL_INTERACTION")
949+
bool sendTargetTemperatureEvent(float temperature, String cause = "PHYSICAL_INTERACTION")
917950
```
918951
| parameter| type | description | value |
919952
|--|--|--|:--:|
920953
| `temperature` | `float` | temperature | `-n`..`n` |
921954
| `cause` | `String` | (optional) describing why this is event ocours | `"PHYSICAL_INTERACTION"` |
955+
| [return] | `bool` | `true` = event was sent, `false` event was not sent | `true` , `false` |
922956
923957
Devices: | [Thermostat](#thermostat) | [Window AC Unit](#window-ac-unit) |
924958
925959
---
926960
927961
### sendTemperatureEvent
928962
```C++
929-
void sendTemperatureEvent(float temperature, float humidity = -1, String cause = "PERIODIC_POLL")
963+
bool sendTemperatureEvent(float temperature, float humidity = -1, String cause = "PERIODIC_POLL")
930964
```
931965
| parameter| type | description | value |
932966
|--|--|--|:--:|
933967
| `temperature` | `float` | temperature | `-n`..`n` |
934968
| `humidity` | `float` | (optional) humidity | `0`..`+n`<br>(`-1` if not supported) |
935969
| `cause` | `String` | (optional) describing why this is event ocours | `"PERIODIC_POLL"` |
970+
| [return] | `bool` | `true` = event was sent, `false` event was not sent | `true` , `false` |
936971

937972
Devices: | [Temperaturesensor](#temperaturesensor) | [Thermostat](#thermostat) | [Window AC Unit](#window-ac-unit) |
938973

939974
---
940975

941976
### sendThermostatModeEvent
942977
```C++
943-
void sendThermostatModeEvent(String thermostatMode, String cause = "PHYSICAL_INTERACTION")
978+
bool sendThermostatModeEvent(String thermostatMode, String cause = "PHYSICAL_INTERACTION")
944979
```
945980
| parameter| type | description | value |
946981
|--|--|--|:--:|
947982
| `thermostatMode` | `String` | thermostat mode | `"COOL"`, `"HEAT"`, `"AUTO"` |
948983
| `cause` | `String` | (optional) describing why this is event ocours | `"PHYSICAL_INTERACTION"` |
984+
| [return] | `bool` | `true` = event was sent, `false` event was not sent | `true` , `false` |
949985
950986
Devices: | [Thermostat](#thermostat) |
951987
@@ -959,6 +995,7 @@ bool sendVolumeEvent(int volume, String cause = "PHYSICAL_INTERACTION")
959995
|--|--|--|:--:|
960996
| `volume` | `int` | report actual volume level| `0`..`100` |
961997
| `cause` | `String` | (optional) describing why this is event ocours | `"PHYSICAL_INTERACTION"` |
998+
| [return] | `bool` | `true` = event was sent, `false` event was not sent | `true` , `false` |
962999

9631000
Devices: | [TV](#tv) | [Speaker](#speaker) |
9641001

0 commit comments

Comments
 (0)