package
0.0.0-20191216020642-7fde5a97f5fa
Repository: https://github.com/afairon/smeter.git
Documentation: pkg.go.dev

# Functions

AddDevice adds a new device to the database.
AddHumidity saves humidity metric to database.
AddPower saves power metric to database.
AddSensor adds a new sensor to the database.
AddTemperature saves temperature metric to database.
CountDevice counts number of devices.
CountSensor counts number of sensors.
DeleteDevice deletes device for a given ID.
DeleteSensor deletes sensor for a given ID.
DeviceActive checks if the device is active.
GetAvgConsumption returns a bucket of average energy consumption.
GetAvgHumidity returns a bucket of average humidity.
GetAvgTemperature returns a bucket of average temperature.
GetDevice retrieves device.
GetDevices returns list of devices.
GetHumidity returns data point of humidity metrics.
GetPower returns power metrics.
GetSensor retrieves sensor.
GetSensors returns list of sensors.
GetTemperature returns data point of temperature metrics.
SensorActive checks if the sensor is active.
UpdateDevice updates device name for a given ID.
UpdateSensor updates device ID and sensor name for a given ID.

# Variables

ErrInvalidName means that the name is invalid.
ErrInvalidReq means that the ID is invalid.
ErrNotFound means that the record is not found.
ErrUnknownSensorType means that the type is set to 0.