biddster / node-red-contrib-schedex

Scheduler for node-red which allows you to enter on/off times as 24hr clock (e.g. 01:10) or suncalc events (e.g. goldenHour). It also allows you to offset times and randomise the time within the offset.
22 stars 17 forks source link

sending msg.payload.suspended: false is possible although node is configured without on or off time #49

Open VanillaFord opened 5 years ago

VanillaFord commented 5 years ago

A node configured without on or off time or "suspend scheduling" set/checked in the config reports its status as "Scheduling suspended", which is perfectly fine according to the documentation. However, sending a msg with "msg.payload.suspended: false" into such a node is possible (works) and a subsequent msg with payload "info" will report the schedule with "suspended: false". The on and off times and "state" also still report as suspended on this node (still according to documentation) and the node status also still reports "Scheduling suspended". This result is an inconsistent node state/status.

Node info as expected: {"ontime":"","ontopic":"vacation","onpayload":"ON","onoffset":0,"onrandomoffset":0,"offtime":"","offtopic":"vacation","offpayload":"OFF","offoffset":0,"offrandomoffset":0,"mon":false,"tue":false,"wed":false,"thu":false,"fri":false,"sat":false,"sun":false,"lon":"","lat":"","suspended":true,"on":"suspended","off":"suspended","state":"suspended"} Node info after sending "msg.payload.suspended: false" into the node: {"ontime":"","ontopic":"vacation","onpayload":"ON","onoffset":0,"onrandomoffset":0,"offtime":"","offtopic":"vacation","offpayload":"OFF","offoffset":0,"offrandomoffset":0,"mon":false,"tue":false,"wed":false,"thu":false,"fri":false,"sat":false,"sun":false,"lon":"","lat":"","suspended":false,"on":"suspended","off":"suspended","state":"suspended"}

expected result: the node should not accept a change from "suspended : true" into "suspended: false" state if there is (still) no on or off time declared (it also should refuse an on command/to go into on state in this case).