gboudreau / nest-api

Unofficial Nest Learning Thermostat API
GNU Lesser General Public License v3.0
300 stars 93 forks source link

Add Sensor Serial and SetTargetTemperatureSensor #138

Closed bauzer714 closed 3 years ago

bauzer714 commented 3 years ago

The sensor serial number was not included in the GetDeviceInfo for individual sensors. Added for consistency as well as required for support of the SetTargetTemperatureSensor function. This new function accepts the serial of the device that you're asking Nest to utilize as the target temperature.

Example Usages:

//Set the sensor in the master bedroom of the default thermostat
$this->setTargetTemperatureSensor("{master bedroom sensor serial number}");

//Set the sensor in the master bedroom of a specific thermostat
$this->setTargetTemperatureSensor("{master bedroom sensor serial number}", "{thermostat serial number}");

//Set the thermostat itself to be the sensor
$this->setTargetTemperatureSensor("{thermostat serial number}");

//Alternatively
$this->setTargetTemperatureSensor("{thermostat serial number}", "{thermostat serial number}");