Hi,
Wondering if I might elicit your help in resolving an issue I’m having. I also posted to the parent project, which you've seen, but that doesn't match well to your current project. I also posted to the Homebridge plug-in development forum on Discord: https://discord.com/channels/432663330281226270/432672072859385856.
I tried to extend your plug-in to also expose a Temperature Sensor that represents the outside temperature. See: https://github.com/cheitzig/homebridge-infinitive-thermostat. FWIW, I think it ultimately should be a platform vs. an accessory because that'd allow, for example, the temperature sensor to be in a different room. The structure of the existing project is to expose the thermostat as a HomeKit accessory, so I added a second service to the Accessory with the idea that it would then expose the outside temperature within the same HomeKit tile. The code I added includes:
- A new “getter” called getCurrentOutsideTemperature
- A new service called TemperatureService
- An attribute to store the Outside temperature
The relevant code line changes (my line numbers) include: 26, 39, 53, 219-248, and 706-717
So it appears correct, but doesn't work, so I must be doing something wrong. I started by writing my own function, getCurrentOutdoorTemperature, and call it on line 709 from the .on('get' of the TemperatureService. When I run it this way though, HomeKit gives an error that says "This accessory isn't responding". getCurrentOutdoorTemperature is almost identical to your existing getCurrentTemperature function with the exception of getting the outside vs. the inside temperature from my furnace API.
If I just hard-set the outdoor temperature (line 39), and update the TemperatureService’s CurrentTemperature characteristic to that value (lines 706-710), the Temperature Sensor shows up fine (granted, just showing the hard-coded temperature). Also, if I call the same “getter” that is used for the internal/house temperature (line 708, currently commented out), things also work fine (or rather, then outside temperature is listed as the inside temperature, which at least appears to work).
To answer your question on the parent GitHub, I don't get an error or dump other than "This accessory isn't responding", although maybe I'm not looking in the right place. It's weird that it works when hard-coded or even calling your existing function, but not when I call my nearly identical function.