hannseman / homebridge-mi-hygrothermograph

Homebridge plugin for the Xiaomi Mi Bluetooth Temperature and Humidity Sensor
MIT License
269 stars 50 forks source link

Support for Elgato EVE History #8

Closed GerSant closed 6 years ago

GerSant commented 6 years ago

Because the nature of the Temperature and Humidity data could be interesting add support for Elgato Eve History Service (https://github.com/simont77/fakegato-history) throught Fakegato History

Thanks in advance

hannseman commented 6 years ago

Good idea! I’ve also been interested to add an an integration with InfluxDB to view graphs with grafana.

I’ve been thinking of adding an abstract LoggingService. Implementations of this interface could be stuff like SysLogService, InfluxDbService and ElgatoEveHistoryService.

The services would be instantiated with config in index.js and then injected into the accessory and used for adding log records.

For this to work access to the config in index.js is required and I haven’t been able to find it on the passed homebridge-object but I’ll have another look when I have time.

hannseman commented 6 years ago

Looks like the config can be accessed from homebridge.user.config.

hannseman commented 6 years ago

Looks like fakegato-history is very dependent on homebridge so it can’t be implemented as a LoggingService.

The best approach is probably to make a subclass of HygrothermographAccessory which sets up fakegato. This subclass will be used instead of the default one when fakegato is configured.

hannseman commented 6 years ago

Fixed in 35a834f1efe561c26086a3b8e15ea6be9803eafa