Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider fan, light, light+fan classes #8

Open
TomFaulkner opened this issue Apr 15, 2017 · 0 comments
Open

Consider fan, light, light+fan classes #8

TomFaulkner opened this issue Apr 15, 2017 · 0 comments

Comments

@TomFaulkner
Copy link
Owner

Is there an advantage to that?

As far as I know a fan without a light kit shouldn't have a problem with irrelevant commands sent to it.

But, what happens when a light query is sent to a fan without a light kit, or a light without a fan?

Potential advantages:
Easier to add other IoT devices if BAF/Haiku makes another IoT device that is neither a fan or a light. (Garage door opener?) Or, perhaps a garage door opener with a light. This would make for fewer methods to have to look through when controlling a device. (Does that matter?)

Potential downsides:
Discovery will end up returning a list of objects that have different methods and user will have to avoid calling a method that isn't appropriate for the device type.

Could alleviate this by allowing for discovery of only fans, only lights, only fans with light kits, only garage door openers, etc.

Complicates things


Thoughts on this are a SenseMe class and Fan, Light, Toaster would inherit from SenseMe. Then a combination device FanWithLight would inherit from Fan and Light.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant