dsensor

package
v0.0.0-...-1830482 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 28, 2019 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Sensor

type Sensor struct {
	IP                         string  `json:"ip"`
	Mac                        string  `json:"mac"`
	Group                      int     `json:"group"`
	Protocol                   string  `json:"protocol"`
	SwitchMac                  string  `json:"switchMac"`
	IsConfigured               bool    `json:"isConfigured"`
	SoftwareVersion            float32 `json:"softwareVersion"`
	HardwareVersion            float32 `json:"hardwareVersion"`
	IsBleEnabled               bool    `json:"isBleEnabled"`
	Temperature                int     `json:"temperature"`
	Humidity                   int     `json:"humidity"`
	Error                      int     `json:"error"`
	Brightness                 int     `json:"brightness"`
	Presence                   bool    `json:"presence"`
	BrightnessCorrectionFactor float32 `json:"brightnessCorrectionFactor"`
	BrightnessCorrectionOffset float32 `json:"brightnessCorrectionOffset"`
	ThresholdPresence          int     `json:"thresholdPresence"`
	TemperatureOffset          int     `json:"temperatureOffset"`
	BrightnessRaw              int     `json:"brightnessRaw"`
	LastMovement               int     `json:"lastMovement"`
	VoltageInput               int     `json:"voltageInput"`
	TemperatureRaw             int     `json:"temperatureRaw"`
	FriendlyName               string  `json:"friendlyName"`
	DumpFrequency              int     `json:"dumpFrequency"`
	BleMode                    string  `json:"bleMode"` //bleMode could be: remote/iBeacon/ptm
	PtmMac                     string  `json:"mac_ptm"` //In ptm mode it corresponds to the enOcean switch
	IBeaconUUID                string  `json:"iBeaconUUID"`
	IBeaconMajor               int     `json:"iBeaconMajor"`
	IBeaconMinor               int     `json:"iBeaconMinor"`
	IBeaconTxPower             int     `json:"iBeaconTxPower"`
	Label                      *string `json:"label,omitempty"`
}

Sensor driver representation

func ToSensor

func ToSensor(val interface{}) (*Sensor, error)

ToSensor convert interface to Sensor object

func (Sensor) ToJSON

func (sensor Sensor) ToJSON() (string, error)

ToJSON dump sensor struct

type SensorConf

type SensorConf struct {
	Mac                        string   `json:"mac"`
	Group                      *int     `json:"group,omitempty"`
	BrightnessCorrectionFactor *float32 `json:"brightnessCorrectionFactor,omitempty"`
	BrightnessCorrectionOffset *float32 `json:"brightnessCorrectionOffset,omitempty"`
	IsConfigured               *bool    `json:"isConfigured,omitempty"`
	ThresholdPresence          *int     `json:"thresholdPresence,omitempty"`
	TemperatureOffset          *int     `json:"temperatureOffset,omitempty"`
	IsBleEnabled               *bool    `json:"isBleEnabled,omitempty"`
	FriendlyName               *string  `json:"friendlyName,omitempty"`
	DumpFrequency              *int     `json:"dumpFrequency,omitempty"`
	Label                      *string  `json:"label,omitempty"`
	BleMode                    *string  `json:"bleMode,omitempty"` //bleMode could be: remote/iBeacon/ptm
	IBeaconUUID                *string  `json:"iBeaconUUID,omitempty"`
	IBeaconMajor               *int     `json:"iBeaconMajor,omitempty"`
	IBeaconMinor               *int     `json:"iBeaconMinor,omitempty"`
	IBeaconTxPower             *int     `json:"iBeaconTxPower,omitempty"`
	PtmMac                     *string  `json:"mac_ptm,omitempty"` //In ptm mode it corresponds to the enOcean switch
}

SensorConf customizable configuration by the server

func ToSensorConf

func ToSensorConf(val interface{}) (*SensorConf, error)

ToSensorConf convert map interface to Sensor object

func (SensorConf) ToJSON

func (sensor SensorConf) ToJSON() (string, error)

ToJSON dump struct in json

type SensorSetup

type SensorSetup struct {
	Mac                        string   `json:"mac"`
	Group                      *int     `json:"group,omitempty"`
	BrightnessCorrectionFactor *float32 `json:"brightnessCorrectionFactor,omitempty"`
	BrightnessCorrectionOffset *float32 `json:"brightnessCorrectionOffset,omitempty"`
	ThresholdPresence          *int     `json:"thresholdPresence,omitempty"`
	TemperatureOffset          *int     `json:"temperatureOffset,omitempty"`
	IsBleEnabled               *bool    `json:"isBleEnabled,omitempty"`
	FriendlyName               *string  `json:"friendlyName,omitempty"`
	SwitchMac                  string   `json:"switchMac"`
	IsConfigured               *bool    `json:"isConfigured,omitempty"`
	DumpFrequency              int      `json:"dumpFrequency"`
	Label                      *string  `json:"label,omitempty"`
	BleMode                    *string  `json:"bleMode,omitempty"` //bleMode could be: remote/iBeacon/ptm
	PtmMac                     *string  `json:"mac_ptm,omitempty"` //In ptm mode it corresponds to the enOcean switch
	IBeaconUUID                *string  `json:"iBeaconUUID,omitempty"`
	IBeaconMajor               *int     `json:"iBeaconMajor,omitempty"`
	IBeaconMinor               *int     `json:"iBeaconMinor,omitempty"`
	IBeaconTxPower             *int     `json:"iBeaconTxPower,omitempty"`
}

SensorSetup initial setup send by the server when the driver is authorized

func FillDefaultValue

func FillDefaultValue(cfg SensorSetup) SensorSetup

FillDefaultValue fill default parameter for setup

func ToSensorSetup

func ToSensorSetup(val interface{}) (*SensorSetup, error)

ToSensorSetup convert interface to SensorSetup object

func UpdateConfig

func UpdateConfig(new SensorConf, old SensorSetup) SensorSetup

func UpdateSetup

func UpdateSetup(new SensorSetup, old SensorSetup) SensorSetup

UpdateSetup update setup struct

func (SensorSetup) ToJSON

func (sensor SensorSetup) ToJSON() (string, error)

ToJSON dump sensor struct

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL