dblind

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 ActionProfile

type ActionProfile struct {
	Action   int  `json:"action"`
	Duration *int `json:"duration,omitempty"`
}

ActionProfile

type Blind

type Blind 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"`
	Error             int     `json:"error"`
	FriendlyName      string  `json:"friendlyName"`
	DumpFrequency     int     `json:"dumpFrequency"`
	WindowStatus1     bool    `json:"windowStatus1"`
	WindowStatus2     bool    `json:"windowStatus2"`
	VoltageInput      int     `json:"voltageInput"`
	DaisyChainEnabled bool    `json:"daisyChainEnabled"`
	DaisyChainPos     int     `json:"daisyChainPos"`
	LinePower         int     `json:"linePower"`
	Blind1            int     `json:"blind1"`
	Blind2            int     `json:"blind2"`
	Slat1             int     `json:"slat1"`
	Slat2             int     `json:"slat2"`
	BleMode           *string `json:"bleMode,omitempty"` //bleMode could be: remote/iBeacon/ptm
	PtmMac            string  `json:"mac_ptm"`           //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"`
	Label             *string `json:"label,omitempty"`
}

Blind driver representation

func ToBlind

func ToBlind(val interface{}) (*Blind, error)

ToBlind convert interface to Sensor object

func (Blind) ToJSON

func (driver Blind) ToJSON() (string, error)

ToJSON dump blind struct

type BlindConf

type BlindConf struct {
	Mac            string  `json:"mac"`
	Group          *int    `json:"group,omitempty"`
	IsConfigured   *bool   `json:"isConfigured,omitempty"`
	IsBleEnabled   *bool   `json:"isBleEnabled,omitempty"`
	FriendlyName   *string `json:"friendlyName,omitempty"`
	DumpFrequency  *int    `json:"dumpFrequency,omitempty"`
	Blind1         *int    `json:"blind1,omitempty"`
	Blind2         *int    `json:"blind2,omitempty"`
	Slat1          *int    `json:"slat1,omitempty"`
	Slat2          *int    `json:"slat2,omitempty"`
	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"`
}

BlindConf customizable configuration by the server

func ToBlindConf

func ToBlindConf(val interface{}) (*BlindConf, error)

ToBlindConf convert map interface to BlindConf object

func (BlindConf) ToJSON

func (driver BlindConf) ToJSON() (string, error)

ToJSON dump struct in json

type BlindProfile

type BlindProfile struct {
	UP           []ActionProfile `json:"up"`
	Down         []ActionProfile `json:"down"`
	Stop         []ActionProfile `json:"stop"`
	WindowOpen   bool            `json:"windowOpen,omitempty"`
	SlatDuration int             `json:"slatDuration,omitempty"`
}

BlindProfile constructor recommendation

type BlindSetup

type BlindSetup struct {
	Mac            string       `json:"mac"`
	Group          *int         `json:"group,omitempty"`
	IsBleEnabled   *bool        `json:"isBleEnabled,omitempty"`
	FriendlyName   *string      `json:"friendlyName,omitempty"`
	SwitchMac      string       `json:"switchMac"`
	IsConfigured   *bool        `json:"isConfigured,omitempty"`
	DumpFrequency  int          `json:"dumpFrequency"`
	Blind1         *int         `json:"blind1,omitempty"`
	Blind2         *int         `json:"blind2,omitempty"`
	Slat1          *int         `json:"slat1,omitempty"`
	Slat2          *int         `json:"slat2,omitempty"`
	Profile        BlindProfile `json:"profile,omitempty"`
	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"`
}

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

func FillDefaultValue

func FillDefaultValue(cfg BlindSetup) BlindSetup

FillDefaultValue fill default parameter for setup

func ToBlindSetup

func ToBlindSetup(val interface{}) (*BlindSetup, error)

ToBlindSetup convert interface to blindsetup object

func UpdateConfig

func UpdateConfig(new BlindConf, old BlindSetup) BlindSetup

func UpdateSetup

func UpdateSetup(new BlindSetup, old BlindSetup) BlindSetup

UpdateSetup update blind struct

func (BlindSetup) ToJSON

func (blind BlindSetup) ToJSON() (string, error)

ToJSON dump blindSetup struct

Jump to

Keyboard shortcuts

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