sean9keenan / homebridge-bigAssFans

A Homebridge plugin for Big Ass Fans
MIT License
28 stars 15 forks source link

Fan code assumes Light is present #4

Closed epahogan closed 7 years ago

epahogan commented 8 years ago

I have a Haiku fan without the built-in light.

I was able to edit index.js and conditionalize the creation of this.lightService based on new config var that I added to the config.json. Not sure how to auto-detect that the light is present/missing.

sean9keenan commented 8 years ago

Hmm, you should be able to access the property fan.light.exists to see if the light exists or not. If you wanted to test it and submit a PR, I'm open to it! I have the full API documented here: https://github.com/sean9keenan/BigAssFansAPI#properties-supported

webdeck commented 7 years ago

I think this is responsible for the error I'm seeing, as one of my fans doesn't have a light:

Sun, 18 Sep 2016 23:04:44 GMT Accessory [Homebridge] Got Characteristic "On" value: undefined Sun, 18 Sep 2016 23:04:44 GMT Accessory [Homebridge] Error getting value for Characteristic "On": Cannot reach fan / property

dsully commented 7 years ago

PR #9 fixes this.