Skip to content

Commit

Permalink
Removed useless logs
Browse files Browse the repository at this point in the history
  • Loading branch information
sahilchaddha committed Dec 10, 2018
1 parent dc62af5 commit eee060b
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/accessories/lightBulb.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,11 @@ const LightBulb = class extends Accessory {
}

updateDevice(light) {
this.logMessage('** Updating Device')
var lightInfo = light
lightInfo.name = light.id
this.ac.context.lightInfo = JSON.stringify(lightInfo)
this.light = lightInfo
this.logMessage('** Should Disconnect & Reconnect : ' + this.isConnected)
this.logMessage('** Device Location Updated. Should Disconnect & Reconnect : ' + this.isConnected, light)
if (this.isConnected) {
this.isConnected = false
this.disconnectDevice()
Expand Down Expand Up @@ -139,9 +138,8 @@ const LightBulb = class extends Accessory {
}

deviceStateChanged(props) {
this.logMessage('Device Response', props)
this.logMessage('Device Response', this.light.id, props)
if (props != null && props.id != null && props.id === 199 && props.result != null && props.result.length > 0) {
this.logMessage('Device Update', this.light.id, props)
const results = props.result
if (results[0] === 'on') {
this.isOn = true
Expand Down Expand Up @@ -172,7 +170,6 @@ const LightBulb = class extends Accessory {
.getCharacteristic(this.homebridge.Characteristic.Brightness)
.updateValue(this.brightness)
if (this.shouldAddColorChar()) {
this.logMessage('Updating Color', this.config.id)
lightbulbService
.getCharacteristic(this.homebridge.Characteristic.Saturation)
.updateValue(this.saturation)
Expand All @@ -181,7 +178,6 @@ const LightBulb = class extends Accessory {
.updateValue(this.hue)
}
if (this.shouldAddCTChar()) {
this.logMessage('Updating CT', this.config.id)
lightbulbService
.getCharacteristic(this.homebridge.Characteristic.ColorTemperature)
.updateValue(this.ct)
Expand All @@ -198,7 +194,6 @@ const LightBulb = class extends Accessory {
callback(null, this.isOn)
})
.on('set', (value, callback) => {
this.logMessage('DEBUG SETTING POWER TO ON')
this.isOn = value
this.sendCommand('power', this.isOn ? 'on' : 'off')
callback()
Expand Down Expand Up @@ -273,7 +268,6 @@ const LightBulb = class extends Accessory {
callback(null, this.isOn)
})
.on('set', (value, callback) => {
this.logMessage('DEBUG SETTING POWER TO ON')
this.isOn = value
this.sendCommand('power', this.isOn ? 'on' : 'off')
callback()
Expand Down

0 comments on commit eee060b

Please sign in to comment.