-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #29 from matiaskorhonen/improvements-and-fixes
Various code improvements and fixes
- Loading branch information
Showing
5 changed files
with
160 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
*.pid.lock | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
|
||
# nyc test coverage | ||
.nyc_output | ||
|
||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# node-waf configuration | ||
.lock-wscript | ||
|
||
# Compiled binary addons (http://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directories | ||
node_modules | ||
jspm_packages | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Optional eslint cache | ||
.eslintcache | ||
|
||
# Optional REPL history | ||
.node_repl_history | ||
|
||
# Output of 'npm pack' | ||
*.tgz | ||
|
||
# Yarn Integrity file | ||
.yarn-integrity | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,45 @@ | ||
# homebridge-http-temperature-humidity | ||
|
||
Supports https devices on HomeBridge Platform | ||
A HTTP(S) temperature and humidity accessory for [Homebridge](https://github.com/nfarina/homebridge). | ||
|
||
# Installation | ||
|
||
1. Install homebridge using: npm install -g homebridge | ||
2. Install this plugin using: npm install -g homebridge-httptemperaturehumidity | ||
3. Update your configuration file. See sample-config.json in this repository for a sample. | ||
1. Install homebridge using: `npm install -g homebridge` | ||
2. Install this plugin using: `npm install -g homebridge-http-temperature-humidity` | ||
3. Update your configuration file. See `sample-config.json` in this repository for a sample. | ||
|
||
# Configuration | ||
|
||
Sample configuration: | ||
|
||
Configuration sample file: | ||
|
||
``` | ||
``` | ||
"accessories": [ | ||
"accessories": [ | ||
{ | ||
"accessory": "HttpTemphum", | ||
"name": "Living Room Weather", | ||
"url": "http://192.168.1.210/weather", | ||
"sendimmediately": "", | ||
"http_method": "GET" | ||
} | ||
] | ||
{ | ||
"accessory": "HttpTemphum", | ||
"name": "Living Room Weather", | ||
"url": "http://192.168.1.210/weather", | ||
"httpMethod": "GET", | ||
"humidity": true, | ||
"cacheExpiration": 60 | ||
} | ||
] | ||
``` | ||
|
||
Set `humidity` to false if your HTTP endpoint doesn't include a humidity reading. | ||
|
||
The `cacheExpiration` option specifies, in seconds, how long HTTP responses will be stored in the in-memory cache. | ||
|
||
--- | ||
|
||
Your HTTP(S) endpoint should produce JSON that looks like this: | ||
|
||
The /weather endpoint will return a json looking like this | ||
``` | ||
{ | ||
"temperature": 25.8, | ||
"humidity": 38 | ||
"temperature": 25.8, | ||
"humidity": 38 | ||
} | ||
``` | ||
|
||
--- | ||
|
||
This plugin acts as an interface between a web endpoint and homebridge only. You will still need some dedicated hardware to expose the web endpoints with the temperature and humidity information. In my case, I used a simple NodeMCU board and a DHT11 (or DHT22). [Check my other repo for the NodeMCU code](https://github.com/lucacri/nodemcu-temperature-humidity-station). | ||
**This plugin only acts as an interface between a web endpoint and Homebridge.** You will still need some dedicated hardware to expose the web endpoints with the temperature and humidity information. In my case, I used a simple NodeMCU board and a DHT11 (or DHT22). [Check my other repo for the NodeMCU code](https://github.com/lucacri/nodemcu-temperature-humidity-station). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters