openHab

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2020 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	STATUS_UNINITIALIZED = "UNINITIALIZED"
	STATUS_INITIALIZING  = "INITIALIZING"
	STATUS_UNKNOWN       = "UNKNOWN"
	STATUS_ONLINE        = "ONLINE"
	STATUS_OFFLINE       = "OFFLINE"
	STATUS_REMOVING      = "REMOVING"
	STATUS_REMOVED       = "REMOVED"

	STATUS_DETAIL_NONE                          = "NONE"
	STATUS_DETAIL_HANDLER_MISSING_ERROR         = "HANDLER_MISSING_ERROR"
	STATUS_DETAIL_HANDLER_REGISTERING_ERROR     = "HANDLER_REGISTERING_ERROR"
	STATUS_DETAIL_HANDLER_INITIALIZING_ERROR    = "HANDLER_INITIALIZING_ERROR"
	STATUS_DETAIL_HANDLER_CONFIGURATION_PENDING = "HANDLER_CONFIGURATION_PENDING"
	STATUS_DETAIL_CONFIGURATION_PENDING         = "CONFIGURATION_PENDING"
	STATUS_DETAIL_COMMUNICATION_ERROR           = "COMMUNICATION_ERROR"
	STATUS_DETAIL_CONFIGURATION_ERROR           = "CONFIGURATION_ERROR"
	STATUS_DETAIL_BRIDGE_OFFLINE                = "BRIDGE_OFFLINE"
	STATUS_DETAIL_FIRMWARE_UPDATING             = "FIRMWARE_UPDATING"
	STATUS_DETAIL_DUTY_CYCLE                    = "DUTY_CYCLE"
	STATUS_DETAIL_BRIDGE_UNINITIALIZED          = "BRIDGE_UNINITIALIZED"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ChannelDTO

type ChannelDTO struct {
	UID            string                 `json:"uid"`
	ID             string                 `json:"id"`
	ChannelTypeUID string                 `json:"channelTypeUID"`
	ItemType       string                 `json:"itemType"`
	Kind           string                 `json:"kind"`
	Label          string                 `json:"label"`
	Description    string                 `json:"description"`
	DefaultTags    []string               `json:"defaultTags"`
	Properties     map[string]interface{} `json:"properties"`
	Configuration  map[string]interface{} `json:"configuration"`
}

func (*ChannelDTO) ConvertUIDToTingUID

func (c *ChannelDTO) ConvertUIDToTingUID() string

func (*ChannelDTO) IsDimmer

func (c *ChannelDTO) IsDimmer() bool

func (*ChannelDTO) IsLight

func (c *ChannelDTO) IsLight() bool

func (*ChannelDTO) IsRGB

func (c *ChannelDTO) IsRGB() bool

func (*ChannelDTO) IsSwitch

func (c *ChannelDTO) IsSwitch() bool

type Client

type Client interface {
	GetThings() ([]EnrichedThingDTO, error)
	GetItem(uid string) (EnrichedItemDTO, error)
}

func NewClient

func NewClient(host string) Client

type EnrichedItemDTO

type EnrichedItemDTO struct {
	Type             string   `json:"type"`
	Name             string   `json:"name"`
	Label            string   `json:"label"`
	Category         string   `json:"category"`
	Tags             []string `json:"tags"`
	GroupNames       []string `json:"group_names"`
	Link             string   `json:"link"`
	State            string   `json:"state"`
	TransformedState string   `json:"transformedState"`
	StateDescription `json:"stateDescription"`
}

func (*EnrichedItemDTO) ChangeBrightnessValue

func (i *EnrichedItemDTO) ChangeBrightnessValue(brightness int)

func (*EnrichedItemDTO) ChangeDefault

func (i *EnrichedItemDTO) ChangeDefault(on bool)

func (*EnrichedItemDTO) ChangeDimmer

func (i *EnrichedItemDTO) ChangeDimmer(brightness int)

func (*EnrichedItemDTO) ChangeHueValue

func (i *EnrichedItemDTO) ChangeHueValue(hue float64)

func (*EnrichedItemDTO) ChangeSaturationValue

func (i *EnrichedItemDTO) ChangeSaturationValue(sat float64)

func (*EnrichedItemDTO) ChangeSwitch

func (i *EnrichedItemDTO) ChangeSwitch(on bool)

func (*EnrichedItemDTO) GetChangeFunction

func (i *EnrichedItemDTO) GetChangeFunction() func(bool)

func (*EnrichedItemDTO) GetCurrentState added in v0.0.7

func (i *EnrichedItemDTO) GetCurrentState() bool

func (*EnrichedItemDTO) GetCurrentValue

func (i *EnrichedItemDTO) GetCurrentValue()

func (*EnrichedItemDTO) SetHVACToMode

func (i *EnrichedItemDTO) SetHVACToMode(mode int)

func (*EnrichedItemDTO) SetTempValue

func (i *EnrichedItemDTO) SetTempValue(temp float64)

func (*EnrichedItemDTO) SwitchDimmer

func (i *EnrichedItemDTO) SwitchDimmer(on bool)

type EnrichedThingDTO

type EnrichedThingDTO struct {
	Label          string                 `json:"label"`
	BridgeUID      string                 `json:"bridgeUID"`
	Configuration  map[string]interface{} `json:"configuration"`
	Properties     map[string]interface{} `json:"properties"`
	UID            string                 `json:"UID"`
	ThingTypeUID   string                 `json:"thingTypeUID"`
	Channels       []ChannelDTO           `json:"channels"`
	Location       string                 `json:"location"`
	StatusInfo     ThingStatusInfo        `json:"statusInfo"`
	FirmwareStatus FirmwareStatusDTO      `json:"firmwareStatus"`
	Editable       bool                   `json:"editable"`
}

type FirmwareStatusDTO

type FirmwareStatusDTO struct {
	Status           string `json:"status"`
	UpdatableVersion string `json:"updatableVersion"`
}

type StateDescription

type StateDescription struct {
	Minimum  int64         `json:"minimum"`
	Maximum  int64         `json:"maximum"`
	Step     int64         `json:"step"`
	Pattern  string        `json:"pattern"`
	ReadOnly bool          `json:"readOnly"`
	Options  []StateOption `json:"options"`
}

type StateOption

type StateOption struct {
	Value string `json:"value"`
	Label string `json:"label"`
}

type ThingStatusInfo

type ThingStatusInfo struct {
	Status       string `json:"status"`
	StatusDetail string `json:"statusDetail"`
	Description  string `json:"description"`
}

Jump to

Keyboard shortcuts

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