Legobas / mqtt-timer

Programmable Timer/Scheduler for MQTT
https://hub.docker.com/r/legobas/mqtt-timer
Apache License 2.0
15 stars 0 forks source link

"enabled":"false" doesn't cancel programmable timer #1

Closed gregmac closed 1 year ago

gregmac commented 1 year ago

Docs state:

Timers can be disabled by sending a message with the enabled field set to false.

Behavior if a message with enabled=false is received:

  • Programmable timer will be removed from the scheduler.

If the enabled field is set no other fields will be applied.

However:

I'm not sure if this is a code or just documentation issue.

Legobas commented 1 year ago

Hi Greg,

You're right, the documentation could be a little bit better about enabling/disabling timers. The problem is that I changed the field from enabled to enable. My motivation for this change was that 'enable' is a command instead of a 'state'.

The message should be like this:

{
  "id": "timer1",
  "enable":"false"
}

or to enable again in the case of a configurable timer:

{
  "id": "timer1",
  "enable":"true"
}
Legobas commented 1 year ago

I updated the readme and the enable field will be validated now.