Skip to content

Commit

Permalink
Merge pull request #11 from sinricpro/dev-2.2.5
Browse files Browse the repository at this point in the history
Dev 2.2.5
  • Loading branch information
sivar2311 authored Dec 2, 2019
2 parents c29fc2a + 1043390 commit b4d6f6a
Show file tree
Hide file tree
Showing 11 changed files with 730 additions and 42 deletions.
69 changes: 53 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

# SinricPro (ESP8266 / ESP32 SDK)
## Version 2.2.4
## Version 2.2.5
## Installation

### VS Code & PlatformIO:
Expand All @@ -24,10 +24,11 @@
## Examples
|PlatformIO|Arduino|
|:--:|:--:|
|[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)|
|[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)|
| - | [GarageDoorOpener](https://github.com/sinricpro/esp8266-esp32-sdk/tree/master/examples/GarageDoor)|
|[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)|
| [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)|
| [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)|
| - | [Lock](https://github.com/sinricpro/esp8266-esp32-sdk/tree/master/examples/GarageDoor)|
| [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)|
| [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)

---

Expand Down Expand Up @@ -160,6 +161,7 @@ Defined in [SinricProTV.h](/src/SinricProTV.h)
Callbacks
- [onPowerState](#onpowerstate)
- [onChangeChannel](#onchangechannel)
- [onChangeChannelNumber](#onchangechannelnumber)
- [onSkipChannels](#onskipchannels)
- [onSelectInput](#onselectinput)
- [onSetVolume](#onsetvolume)
Expand Down Expand Up @@ -448,6 +450,21 @@ Devices: | [TV](#tv) |

---

### onChangeChannelNumber
```C++
bool onChangeChannelNumber(const String &deviceId, int channelNumber, String &channelName)
```
| parameter | type| input value | output value | example |
|--|--|--|--|-- |
| `deviceId` | `const String&` | `deviceId` | --- | `"5d8f5ade41307b450335925d"` |
| `channelNumber` | `int` | `0..n` | --- | `4` |
|`channelName` | `String&` | --- | `channel name` | `"HBO"` (name of a tv channel) |
| `[return]`| `bool` | --- | `true`: request handled properly<br>`false`: error | `true` |
Devices: | [TV](#tv) |
---
### onColor
```C++
bool onColor(const String &deviceId, byte &r, byte &g, byte &b)
Expand Down Expand Up @@ -723,19 +740,21 @@ bool sendBandsEvent(String bands, int level, String cause = "PHYSICAL_INTERACTIO
| `bands` | `String` | selected band | `"BASS"`, `"MIDRANGE"`,`"TREBBLE"` |
| `level` | `int` | report new band level | `0`..`n` |
| `cause` | `String` | (optional) describing why this is event ocours | `"PHYSICAL_INTERACTION"` |
| [return] | `bool` | `true` = event was sent, `false` event was not sent | `true` , `false` |

Devices: | [Speaker](#speaker) |

---

### sendBrightnessEvent
```C++
void sendBrightnessEvent(int brightness, String cause = "PHYSICAL_INTERACTION")
bool sendBrightnessEvent(int brightness, String cause = "PHYSICAL_INTERACTION")
```
| parameter| type | description | value |
|--|--|--|:--:|
| `brightness` | `int` | brightness level | `0`..`100`|
| `cause` | `String` | (optional) describing why this is event ocours | `"PHYSICAL_INTERACTION"` |
| [return] | `bool` | `true` = event was sent, `false` event was not sent | `true` , `false` |
Devices: | [Light](#light) |
Expand All @@ -749,59 +768,64 @@ bool sendChangeChannelEvent(String channelName, String cause = "PHYSICAL_INTERAC
|--|--|--|:--:|
| `channelName` | `String` | report new channel | example: `"HBO"` |
| `cause` | `String` | (optional) describing why this is event ocours | `"PHYSICAL_INTERACTION"` |
| [return] | `bool` | `true` = event was sent, `false` event was not sent | `true` , `false` |

Devices: | [TV](#tv) |

---

### sendColorEvent
```C++
void sendColorEvent(byte r, byte g, byte b, String cause = "PHYSICAL_INTERACTION")
bool sendColorEvent(byte r, byte g, byte b, String cause = "PHYSICAL_INTERACTION")
```
| parameter| type | description | value |
|--|--|--|:--:|
| `r` | `byte` | red value | `0`..`255` |
| `g` | `byte` | green value | `0`..`255` |
| `b` | `byte` | blue value | `0`..`255` |
| `cause` | `String` | (optional) describing why this is event ocours | `"PHYSICAL_INTERACTION"` |
| [return] | `bool` | `true` = event was sent, `false` event was not sent | `true` , `false` |
Devices: | [Light](#light) |
---
### sendColorTemperatureEvent
```C++
void sendColorTemperatureEvent(int colorTemperature, String cause = "PHYSICAL_INTERACTION")
bool sendColorTemperatureEvent(int colorTemperature, String cause = "PHYSICAL_INTERACTION")
```
| parameter| type | description | value |
|--|--|--|:--:|
| `colorTemperature` | `int` | color temperature | `2200`, `2700`, `4000`, `5500`, `7000` |
| `cause` | `String` | (optional) describing why this is event ocours | `"PHYSICAL_INTERACTION"` |
| [return] | `bool` | `true` = event was sent, `false` event was not sent | `true` , `false` |

Devices: | [Light](#light) |

---

### sendContactEvent
```C++
void sendContactEvent(bool detected, String cause = "PHYSICAL_INTERACTION")
bool sendContactEvent(bool detected, String cause = "PHYSICAL_INTERACTION")
```
| parameter| type | description | value |
|--|--|--|:--:|
| `detected` | `bool` | report contact state | `true`: contact is closed<br>`false`: contact is open |
| `cause` | `String` | (optional) describing why this is event ocours | `"PHYSICAL_INTERACTION"` |
| [return] | `bool` | `true` = event was sent, `false` event was not sent | `true` , `false` |
Devices: | [ContactSensor](#contactsensor) |
---
### sendDoorbellEvent
```C++
void sendDoorbellEvent(String cause = "PHYSICAL_INTERACTION")
bool sendDoorbellEvent(String cause = "PHYSICAL_INTERACTION")
```
| parameter| type | description | value |
|--|--|--|:--:|
| `cause` | `String` | (optional) describing why this is event ocours | `"PHYSICAL_INTERACTION"` |
| [return] | `bool` | `true` = event was sent, `false` event was not sent | `true` , `false` |

Devices: | [Doorbell](#doorbell) |

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

Devices: | [Speaker](#speaker) |

---

### sendMotionEvent
```C++
void sendMotionEvent(bool detected, String cause = "PHYSICAL_INTERACTION")
bool sendMotionEvent(bool detected, String cause = "PHYSICAL_INTERACTION")
```
| parameter| type | description | value |
|--|--|--|:--:|
| `detected` | `bool` | report motion event | `true`: motion detected<br>`false`: motion not detected (should be sent if motion not happens any longer) |
| `cause` | `String` | (optional) describing why this is event ocours | `"PHYSICAL_INTERACTION"` |
| [return] | `bool` | `true` = event was sent, `false` event was not sent | `true` , `false` |
Devices: | [MotionSensor](#motionsensor) |
Expand All @@ -854,34 +881,38 @@ bool sendMuteEvent(bool mute, String cause = "PHYSICAL_INTERACTION")
|--|--|--|:--:|
| `mute` | `bool` | report mute event | `true`: device is muted <br>`false`: device is unmuted |
| `cause` | `String` | (optional) describing why this is event ocours | `"PHYSICAL_INTERACTION"` |
| [return] | `bool` | `true` = event was sent, `false` event was not sent | `true` , `false` |

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

---

### sendPowerLevelEvent
```C++
sendPowerLevelEvent(int level, String cause="PHYSICAL_INTERACTION")
bool sendPowerLevelEvent(int level, String cause="PHYSICAL_INTERACTION")
```
| parameter| type | description | value |
|--|--|--|:--:|
| `level` | `int` | device power level | `0`..`100`|
| `cause` | `String` | (optional) describing why this is event ocours | `"PHYSICAL_INTERACTION"` |
| [return] | `bool` | `true` = event was sent, `false` event was not sent | `true` , `false` |
Devices: | [Dimmable Switch](#dimmable-switch) | [Fan (non US)](#fan-non-us) |
---
### sendPowerStateEvent
```C++
sendPowerStateEvent(bool state, String cause="PHYSICAL_INTERACTION")
bool sendPowerStateEvent(bool state, String cause="PHYSICAL_INTERACTION")
```
| parameter| type | description | value |
|--|--|--|--|
| `state` | `bool` | device state |`true`: device is on<br>`false`: device is off |
| `cause` | `String` | (optional) describing why this is event ocours | `"PHYSICAL_INTERACTION"`
| [return] | `bool` | `true` = event was sent, `false` event was not sent | `true` , `false` |

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) |
| [return] | `bool` | `true` = event was sent, `false` event was not sent | `true` , `false` |

---

Expand All @@ -893,6 +924,7 @@ bool sendRangeValueEvent(int rangeValue, String cause = "PHYSICAL_INTERACTION")
|--|--|--|:--:|
| `rangeValue` | `int` | report actual range value | `0`..`n` |
| `cause` | `String` | (optional) describing why this is event ocours | `"PHYSICAL_INTERACTION"` |
| [return] | `bool` | `true` = event was sent, `false` event was not sent | `true` , `false` |
Devices: | [Fan (US)](#fan-us) | [Window AC Unit](#window-ac-unit) |
Expand All @@ -906,46 +938,50 @@ bool sendSelectInputEvent(String intput, String cause = "PHYSICAL_INTERACTION")
|--|--|--|:--:|
| `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"` |
| `cause` | `String` | (optional) describing why this is event ocours | `"PHYSICAL_INTERACTION"` |
| [return] | `bool` | `true` = event was sent, `false` event was not sent | `true` , `false` |

Devices: | [TV](#tv) |

---

### sendTargetTemperatureEvent
```C++
void sendTargetTemperatureEvent(float temperature, String cause = "PHYSICAL_INTERACTION")
bool sendTargetTemperatureEvent(float temperature, String cause = "PHYSICAL_INTERACTION")
```
| parameter| type | description | value |
|--|--|--|:--:|
| `temperature` | `float` | temperature | `-n`..`n` |
| `cause` | `String` | (optional) describing why this is event ocours | `"PHYSICAL_INTERACTION"` |
| [return] | `bool` | `true` = event was sent, `false` event was not sent | `true` , `false` |
Devices: | [Thermostat](#thermostat) | [Window AC Unit](#window-ac-unit) |
---
### sendTemperatureEvent
```C++
void sendTemperatureEvent(float temperature, float humidity = -1, String cause = "PERIODIC_POLL")
bool sendTemperatureEvent(float temperature, float humidity = -1, String cause = "PERIODIC_POLL")
```
| parameter| type | description | value |
|--|--|--|:--:|
| `temperature` | `float` | temperature | `-n`..`n` |
| `humidity` | `float` | (optional) humidity | `0`..`+n`<br>(`-1` if not supported) |
| `cause` | `String` | (optional) describing why this is event ocours | `"PERIODIC_POLL"` |
| [return] | `bool` | `true` = event was sent, `false` event was not sent | `true` , `false` |

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

---

### sendThermostatModeEvent
```C++
void sendThermostatModeEvent(String thermostatMode, String cause = "PHYSICAL_INTERACTION")
bool sendThermostatModeEvent(String thermostatMode, String cause = "PHYSICAL_INTERACTION")
```
| parameter| type | description | value |
|--|--|--|:--:|
| `thermostatMode` | `String` | thermostat mode | `"COOL"`, `"HEAT"`, `"AUTO"` |
| `cause` | `String` | (optional) describing why this is event ocours | `"PHYSICAL_INTERACTION"` |
| [return] | `bool` | `true` = event was sent, `false` event was not sent | `true` , `false` |
Devices: | [Thermostat](#thermostat) |
Expand All @@ -959,6 +995,7 @@ bool sendVolumeEvent(int volume, String cause = "PHYSICAL_INTERACTION")
|--|--|--|:--:|
| `volume` | `int` | report actual volume level| `0`..`100` |
| `cause` | `String` | (optional) describing why this is event ocours | `"PHYSICAL_INTERACTION"` |
| [return] | `bool` | `true` = event was sent, `false` event was not sent | `true` , `false` |

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

Expand Down
Loading

0 comments on commit b4d6f6a

Please sign in to comment.