Skip to content
This repository has been archived by the owner on Jun 23, 2022. It is now read-only.

Commit

Permalink
Improve logging
Browse files Browse the repository at this point in the history
  • Loading branch information
robbiet480 committed Oct 30, 2016
1 parent 486884f commit 2a8d9b3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
3 changes: 3 additions & 0 deletions accessories/binary_sensor.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ function HomeAssistantBinarySensorFactory(log, data, client) {
Characteristic.SmokeDetected.SMOKE_DETECTED,
Characteristic.SmokeDetected.SMOKE_NOT_DETECTED);
default:
log.error("'"+data.entity_id+"' has a sensor_class of '"+data.attributes.sensor_class+"' which is not supported by " +
"homebridge-homeassistant. Supported classes are 'moisture', 'motion', 'occupancy', 'opening' and 'smoke'. "+
"See the README.md for more information.")
return null;
}
}
Expand Down
9 changes: 3 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ var HomeAssistantSensorFactory;
var HomeAssistantBinarySensorFactory;

module.exports = function(homebridge) {
console.log("homebridge API version: " + homebridge.version);

Service = homebridge.hap.Service;
Characteristic = homebridge.hap.Characteristic;
Accessory = homebridge.platformAccessory;
Expand All @@ -38,7 +36,6 @@ module.exports = function(homebridge) {

function HomeAssistantPlatform(log, config, api){
// auth info
console.log("Booting Platform");
this.host = config.host;
this.password = config.password;
this.supportedTypes = config.supported_types;
Expand All @@ -53,9 +50,9 @@ function HomeAssistantPlatform(log, config, api){
// Listen to event "didFinishLaunching", this means homebridge already finished loading cached accessories
// Platform Plugin should only register new accessory that doesn't exist in homebridge after this event.
// Or start discover new accessories
this.api.on('didFinishLaunching', function() {
console.log("Plugin - DidFinishLaunching");
}.bind(this));
// this.api.on('didFinishLaunching', function() {
// console.log("Plugin - DidFinishLaunching");
// }.bind(this));
}

var es = new EventSource(config.host + '/api/stream?api_password=' + encodeURIComponent(this.password));
Expand Down

0 comments on commit 2a8d9b3

Please sign in to comment.