t/set/device.html: do not allow custom functions to be given to sensors if they have empty args field.

Issue #247 new
Trek Hopton created an issue

A device was mistakenly given a custom function without providing arguments (which should contain the custom function as commented on sensor.go ln. 126:

    // It is expected that the args string contains the custom function, and only
    // the custom function, otherwise errors will likely follow from govaluate.
    // The value to be transformed is represented by x e.g. (x + 3)/2.

This resulted in the monitor page not loading because it could not transform the sensor value. See issue #245.

This should not happen, we should check for an empty argument field and display an error to the user if it is empty. Even better we should check if the function is valid, but just an empty check will suffice for this issue.

Comments (1)

  1. Log in to comment