api

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2024 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EventItemAdded              = "ItemAddedEvent"              // An item has been added to the item registry.
	EventItemRemoved            = "ItemRemovedEvent"            // An item has been removed from the item registry.
	EventItemUpdated            = "ItemUpdatedEvent"            // An item has been updated in the item registry.
	EventItemCommand            = "ItemCommandEvent"            // A command is sent to an item via a channel.
	EventItemState              = "ItemStateEvent"              // The state of an item is updated.
	EventItemStateUpdated       = "ItemStateUpdatedEvent"       // The state of an item is updated - since OH 4.0
	EventItemStatePredicted     = "ItemStatePredictedEvent"     // The state of an item predicted to be updated.
	EventItemStateChanged       = "ItemStateChangedEvent"       // The state of an item has changed.
	EventGroupItemStateUpdated  = "GroupStateUpdatedEvent"      // The state of a group of items has been updated through a member.
	EventGroupItemStateChanged  = "GroupItemStateChangedEvent"  // The state of a group item has changed through a member.
	EventThingAdded             = "ThingAddedEvent"             // A thing has been added to the thing registry.
	EventThingRemoved           = "ThingRemovedEvent"           // A thing has been removed from the thing registry.
	EventThingUpdated           = "ThingUpdatedEvent"           // A thing has been updated in the thing registry.
	EventThingStatusInfo        = "ThingStatusInfoEvent"        // The status of a thing is updated.
	EventThingStatusInfoChanged = "ThingStatusInfoChangedEvent" // The status of a thing changed.
	EventInboxAdded             = "InboxAddedEvent"             // A discovery result has been added to the inbox.
	EventInboxRemoved           = "InboxRemovedEvent"           // A discovery result has been removed from the inbox.
	EventInboxUpdate            = "InboxUpdateEvent"            // A discovery result has been updated in the inbox.
	EventItemChannelLinkAdded   = "ItemChannelLinkAddedEvent"   // An item channel link has been added to the registry.
	EventItemChannelLinkRemoved = "ItemChannelLinkRemovedEvent" // An item channel link has been removed from the registry.
	EventChannelTriggered       = "ChannelTriggeredEvent"       // A channel has been triggered.
	// event added in API v5
	EventTypeAlive      = "ALIVE"           // API version >=5 sends ALIVE events (every minute or so)
	EventTypeStartlevel = "StartlevelEvent" // Event sent during server startup (typically from 30 to 100)
)
View Source
const (
	TopicEventAdded          = "added"          // item, thing, inbox, link
	TopicEventRemoved        = "removed"        // item, thing, inbox, link
	TopicEventUpdated        = "updated"        // item, thing, inbox
	TopicEventCommand        = "command"        // item
	TopicEventState          = "state"          // item
	TopicEventStateUpdated   = "stateupdated"   // item
	TopicEventStatePredicted = "statepredicted" // item
	TopicEventStateChanged   = "statechanged"   // item
	TopicEventStatus         = "status"         // thing
	TopicEventStatusChanged  = "statuschanged"  // thing
	TopicEventTriggered      = "triggered"      // channel
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CommandDescription

type CommandDescription struct {
	Options []CommandOptions `json:"commandOptions"`
}

type CommandOptions

type CommandOptions struct {
	Command string `json:"command"`
	Label   string `json:"label"`
}

type EventCommand

type EventCommand struct {
	Type  string `json:"type"`
	Value string `json:"value"`
}

type EventMessage

type EventMessage struct {
	Topic   string `json:"topic"`
	Payload string `json:"payload"`
	Type    string `json:"type"`
}

type EventState

type EventState struct {
	Type  string `json:"type"`
	Value string `json:"value"`
}

type EventStateChanged

type EventStateChanged struct {
	Type     string `json:"type"`
	Value    string `json:"value"`
	OldType  string `json:"oldType"`
	OldValue string `json:"oldValue"`
}

type EventStatePredicted

type EventStatePredicted struct {
	PredictedType  string `json:"predictedType"`
	PredictedValue string `json:"predictedValue"`
	IsConfirmation bool   `json:"isConfirmation"`
}

type EventStatus

type EventStatus struct {
	Status       string `json:"status"`
	StatusDetail string `json:"statusDetail"`
}

type EventTriggered

type EventTriggered struct {
	Event   string `json:"event"`
	Channel string `json:"channel"`
}

type Function

type Function struct {
	Name   string   `json:"name"`
	Params []string `json:"params"`
}

type Item

type Item struct {
	Name               string              `json:"name"`
	Label              string              `json:"label"`
	Link               string              `json:"link"`
	Type               string              `json:"type"`
	State              string              `json:"state"`
	TransformedState   string              `json:"transformedState,omitempty"`
	Editable           bool                `json:"editable"`
	Category           string              `json:"category"`
	Tags               []string            `json:"tags"`
	GroupNames         []string            `json:"groupNames"`
	GroupType          string              `json:"groupType,omitempty"`
	Function           *Function           `json:"function,omitempty"`
	StateDescription   *StateDescription   `json:"stateDescription,omitempty"`
	CommandDescription *CommandDescription `json:"commandDescription,omitempty"`
	Members            []*Item             `json:"members,omitempty"` // this field is only populated with ?recursive=true parameter
}

Item structure in the openHAB API

type Startlevel added in v0.8.0

type Startlevel struct {
	Startlevel int `json:"startlevel"`
}

type StateDescription

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

type StateOptions

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

type Thing added in v0.7.0

type Thing struct {
	UID           string            `json:"UID"`
	Label         string            `json:"label"`
	StatusInfo    ThingStatusInfo   `json:"statusInfo"`
	BridgeUID     string            `json:"bridgeUID"`
	Configuration map[string]any    `json:"configuration"`
	Properties    map[string]string `json:"properties"`
	ThingTypeUID  string            `json:"thingTypeUID"`
}

Thing structure in the openHAB API

type ThingStatusInfo added in v0.7.0

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