monitor: Sensors not formatted

Issue #373 new
Alan Noble created an issue

Sensors are not formatted according to the user-specified format function, i.e., round, round1, etc.

Comments (1)

  1. David Sutton

    What are the intended formats bool, hex, and compass?

    ISTM that the issue is arising from monitor.go:250

    sensorData := sensorData{
                Name:   sensor.Name,
                Units:  sensor.Units,
                Scalar: fmt.Sprintf("%.2f", value),
                Date:   time.Unix(scalar.Timestamp, 0).In(fixedTimezone(tz)).Format("Jan 2 15:04:05"),
            }
    

    Where all formats are given to 2 decimal places. I suggest implementing a method of iotds.Sensor called FormatSensor which returns a string for a given float based on the format in s.Format.

  2. Log in to comment