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

Export class instead of instance #13

Closed
insolite opened this issue Jan 10, 2018 · 1 comment · Fixed by #14
Closed

Export class instead of instance #13

insolite opened this issue Jan 10, 2018 · 1 comment · Fixed by #14

Comments

@insolite
Copy link

How about exporting of class instead of already created instance here?
Some kind of

module.exports = rcswitch.RCSwitch;

I understand that this appear to be a compatibility breaking update, so we can think of another exporting way or making of major version bump.

Let me clarify why it's important.
Sometimes it's good to have different instances of RcSwitch for different purposes. It may be very useful especially alongside the code receiving. In rcswitch there is a disabling of receiving while transmitting data, so theoretically it should work simultaneously. But in fact there are some issues with receiving after transmission. I didn't dig much in that problem cause:

  1. It works perfectly with 2 instances of RcSwitch anyway.
  2. We don't need to stop receiving at all cause we're using different PINs for sending and receiving.
@insolite
Copy link
Author

insolite commented Jan 10, 2018

Well, I think I found the reason for breaking of signal receiving after transmitting. First off, that happends when the rcswitch is disabling/enabling receiving while transmitting. I've described details here for rc-switch repo.

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

Successfully merging a pull request may close this issue.

1 participant