Skip to content

Commit f9aab15

Browse files
committed
Use accurate display (service) names for sensors. Added TODO/Roadmap for future development and testing.
1 parent 2edc8c6 commit f9aab15

4 files changed

Lines changed: 20 additions & 3 deletions

File tree

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,21 @@
44

55
</p>
66

7+
# Ideal Sciences Temp Stick Homebridge Plugin
8+
9+
This is an unnofficial plugin to use your [Temp Stick](https://tempstick.com/) sensor with Homebridge.
10+
11+
You will need your API key, provided in your [account](https://mytempstick.com/account#developers) settings.
12+
13+
### Development Roadmap:
14+
- [x] Discover all sensors and probes
15+
- [x] Ambient temperature, ambient humidity, and probe temperature
16+
- [ ] Handle API errors gracefully
17+
- [ ] Use offsets (`probe_temp_offset`, `humidity_offset`, `temp_offset`) for calibrated sensors
18+
- [ ] Request latest readings based on `send_interval` and `next_checkin`
19+
- [ ] Request updated documentation in [API](https://tempstickapi.com/docs/) for undocumented parameters
20+
(`last_tcTemp`, for example)
21+
722
<span align="center">
823

924
# Homebridge Platform Plugin Template

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{
2-
"private": true,
32
"displayName": "TempStick",
43
"name": "homebridge-tempstick",
54
"version": "1.0.0",

src/platform.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ export class TempStickHomebridgePlatform implements DynamicPlatformPlugin {
126126
});
127127

128128
} catch (err) {
129-
// TODO: Catch 406 and other errors and handle gracefully
129+
// TODO: Catch 406 and other errors (bad API key, network issue, etc) and handle gracefully
130130
if (err instanceof TypeError) {
131131
this.log.error(err.message);
132132
}

src/platformAccessory.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,21 +47,24 @@ export class TempStickAccessory {
4747
// Example: add two "motion sensor" services to the accessory
4848
const ambientTemperatureService = this.accessory.getService('Ambient Temperature Sensor') ||
4949
this.accessory.addService(this.platform.Service.TemperatureSensor, 'Ambient Temperature Sensor', 'AmbientTemperatureSensor');
50+
ambientTemperatureService.setCharacteristic(this.platform.Characteristic.Name, accessory.displayName + ' Ambient Temp Sensor');
51+
5052

5153
// undocumented in V1 API, TODO: test if this exists without a probe
5254
const probe = !!accessory.context.device.last_tcTemp;
5355
let probeTemperatureService: Service | undefined = undefined;
5456
if (probe) {
5557
probeTemperatureService = this.accessory.getService('Probe Temperature Sensor') ||
5658
this.accessory.addService(this.platform.Service.TemperatureSensor, 'Probe Temperature Sensor', 'ProbeTemperatureSensor');
59+
probeTemperatureService.setCharacteristic(this.platform.Characteristic.Name, accessory.displayName + ' Probe Temp Sensor');
5760
}
5861

5962
this.service = this.accessory.getService(this.platform.Service.HumiditySensor)
6063
|| this.accessory.addService(this.platform.Service.HumiditySensor);
6164

6265
// set the service name, this is what is displayed as the default name on the Home app
6366
// in this example we are using the name we stored in the `accessory.context` in the `discoverDevices` method.
64-
this.service.setCharacteristic(this.platform.Characteristic.Name, accessory.displayName);
67+
this.service.setCharacteristic(this.platform.Characteristic.Name, accessory.displayName + ' Humidity Sensor');
6568

6669
// each service must implement at-minimum the "required characteristics" for the given service type
6770
// see https://developers.homebridge.io/#/service/Lightbulb

0 commit comments

Comments
 (0)