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

MQTT dynamic pulse timer for relays #902

Merged
merged 2 commits into from
Jun 12, 2018

Conversation

mcspr
Copy link
Collaborator

@mcspr mcspr commented May 30, 2018

Resolves #816 (ticker revert) and #831 (/pulse/set)
Add {root}/relay/N/pulse/set setter to toggle relay for specified time.
Display pulse time and mode in terminal.

Overrides relay pulse settings and starts ticker with them. Resets to values from settings after starting.

@mcspr mcspr force-pushed the mqtt-dynamic-pulse branch 2 times, most recently from 639fcdb to d3ad0a8 Compare May 30, 2018 08:50
@xoseperez xoseperez merged commit f4de7c0 into xoseperez:dev Jun 12, 2018
@xoseperez
Copy link
Owner

Merged but I did some changes:

  • Pulse payload in millis to allow under 1s pulses
  • Added same functionality for HTTP API
  • Topic set to pulse/+ instead of relay/+/pulse

@mcspr
Copy link
Collaborator Author

mcspr commented Jun 12, 2018

But it did use floats as an input - just like web does. Settings stored as floats too thus the conversion for getSetting. Subsecond values for web: 0.1s === 100ms

HTTP API is nice, yes 👍

@mcspr mcspr deleted the mqtt-dynamic-pulse branch June 12, 2018 20:32
@xoseperez
Copy link
Owner

You are right, do you think we should use the same units in web interface and mqtt/api

@mcspr
Copy link
Collaborator Author

mcspr commented Jun 13, 2018

Maybe just use ms everywhere? Gets rid of multiple divisions / multiplications and web would not require some clever hint to denote 0. value usage (it is obvious only if implementation is known beforehand)

I see that 74e27ee had already changed this.

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 this pull request may close these issues.

None yet

2 participants