Documentation
¶
Index ¶
- func NewEventBus(async bool) *eventBus
- type AliveEvent
- type ChannelTriggered
- type ErrorEvent
- type Event
- type GenericEvent
- type GroupItemStateChanged
- type GroupItemStateUpdated
- type Item
- type ItemAdded
- type ItemReceivedCommand
- type ItemReceivedState
- type ItemRemoved
- type ItemStateChanged
- type ItemStatePredicted
- type ItemStateUpdated
- type ItemUpdated
- type PubSub
- type StartlevelEvent
- type SystemEvent
- type Thing
- type ThingStatus
- type ThingStatusInfoChangedEvent
- type ThingStatusInfoEvent
- type ThingUpdated
- type Type
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewEventBus ¶
func NewEventBus(async bool) *eventBus
Types ¶
type AliveEvent ¶ added in v0.7.0
type AliveEvent struct{}
AliveEvent is regularly sent by openHAB 3.4+ (API v5+)
func NewAliveEvent ¶ added in v0.7.0
func NewAliveEvent() AliveEvent
func (AliveEvent) Topic ¶ added in v0.7.0
func (e AliveEvent) Topic() string
func (AliveEvent) Type ¶ added in v0.7.0
func (e AliveEvent) Type() Type
func (AliveEvent) TypeName ¶ added in v0.7.0
func (e AliveEvent) TypeName() string
type ChannelTriggered ¶ added in v0.8.0
type ChannelTriggered struct { ChannelName string Event string // contains filtered or unexported fields }
func NewChannelTriggered ¶ added in v0.8.0
func NewChannelTriggered(channelName, event string) ChannelTriggered
func (ChannelTriggered) Topic ¶ added in v0.8.0
func (i ChannelTriggered) Topic() string
func (ChannelTriggered) Type ¶ added in v0.8.0
func (i ChannelTriggered) Type() Type
type ErrorEvent ¶ added in v0.3.0
type ErrorEvent struct {
// contains filtered or unexported fields
}
ErrorEvent is used for errors generated by the client
func NewErrorEvent ¶ added in v0.3.0
func NewErrorEvent(err error) ErrorEvent
NewErrorEvent creates ClientError event type
func (ErrorEvent) Error ¶ added in v0.3.0
func (e ErrorEvent) Error() error
Error returns the error that triggered the event
func (ErrorEvent) Topic ¶ added in v0.3.0
func (e ErrorEvent) Topic() string
Topic is always empty on ErrorEvent
type GenericEvent ¶
type GenericEvent struct {
// contains filtered or unexported fields
}
GenericEvent is used when its type is unknown
func NewGenericEvent ¶ added in v0.5.0
func NewGenericEvent(eventType, topic, payload string) GenericEvent
func (GenericEvent) Payload ¶
func (e GenericEvent) Payload() string
func (GenericEvent) Topic ¶
func (e GenericEvent) Topic() string
func (GenericEvent) Type ¶
func (e GenericEvent) Type() Type
func (GenericEvent) TypeName ¶
func (e GenericEvent) TypeName() string
type GroupItemStateChanged ¶
type GroupItemStateChanged struct { ItemName string TriggeringItem string NewStateType string NewState string PreviousStateType string PreviousState string // contains filtered or unexported fields }
func NewGroupItemStateChanged ¶
func NewGroupItemStateChanged(itemName, triggeringItem, previousStateType, previousState, newStateType, newState string) GroupItemStateChanged
func (GroupItemStateChanged) Topic ¶
func (i GroupItemStateChanged) Topic() string
func (GroupItemStateChanged) Type ¶
func (i GroupItemStateChanged) Type() Type
type GroupItemStateUpdated ¶ added in v0.9.0
type GroupItemStateUpdated struct { ItemName string TriggeringItem string StateType string State string // contains filtered or unexported fields }
GroupItemStateUpdated is sent when the state of a group of items has been updated.
func NewGroupItemStateUpdated ¶ added in v0.9.0
func NewGroupItemStateUpdated(itemName, triggeringItem, stateType, state string) GroupItemStateUpdated
func (GroupItemStateUpdated) Topic ¶ added in v0.9.0
func (i GroupItemStateUpdated) Topic() string
func (GroupItemStateUpdated) Type ¶ added in v0.9.0
func (i GroupItemStateUpdated) Type() Type
type ItemAdded ¶
type ItemAdded struct { Item Item // contains filtered or unexported fields }
func NewItemAdded ¶ added in v0.5.0
type ItemReceivedCommand ¶
type ItemReceivedCommand struct { ItemName string CommandType string Command string // contains filtered or unexported fields }
func NewItemReceivedCommand ¶
func NewItemReceivedCommand(itemName, commandType, command string) ItemReceivedCommand
func (ItemReceivedCommand) Topic ¶
func (i ItemReceivedCommand) Topic() string
func (ItemReceivedCommand) Type ¶
func (i ItemReceivedCommand) Type() Type
type ItemReceivedState ¶
type ItemReceivedState struct { ItemName string StateType string State string // contains filtered or unexported fields }
ItemReceivedState is sent when the state of an item is about to get updated.
func NewItemReceivedState ¶
func NewItemReceivedState(itemName, stateType, state string) ItemReceivedState
func (ItemReceivedState) Topic ¶
func (i ItemReceivedState) Topic() string
func (ItemReceivedState) Type ¶
func (i ItemReceivedState) Type() Type
type ItemRemoved ¶
type ItemRemoved struct { Item Item // contains filtered or unexported fields }
func NewItemRemoved ¶ added in v0.5.0
func NewItemRemoved(item Item) ItemRemoved
func (ItemRemoved) Topic ¶
func (i ItemRemoved) Topic() string
func (ItemRemoved) Type ¶
func (i ItemRemoved) Type() Type
type ItemStateChanged ¶
type ItemStateChanged struct { ItemName string NewStateType string NewState string PreviousStateType string PreviousState string // contains filtered or unexported fields }
ItemStateChanged is sent when the state of an item has changed.
func NewItemStateChanged ¶
func NewItemStateChanged(itemName, previousStateType, previousState, newStateType, newState string) ItemStateChanged
func (ItemStateChanged) Topic ¶
func (i ItemStateChanged) Topic() string
func (ItemStateChanged) Type ¶
func (i ItemStateChanged) Type() Type
type ItemStatePredicted ¶ added in v0.8.0
type ItemStatePredicted struct { ItemName string PredictedType string PredictedState string // contains filtered or unexported fields }
func NewItemStatePredicted ¶ added in v0.8.0
func NewItemStatePredicted(itemName, predictedStateType, predictedState string) ItemStatePredicted
func (ItemStatePredicted) Topic ¶ added in v0.8.0
func (i ItemStatePredicted) Topic() string
func (ItemStatePredicted) Type ¶ added in v0.8.0
func (i ItemStatePredicted) Type() Type
type ItemStateUpdated ¶ added in v0.8.0
type ItemStateUpdated struct { ItemName string StateType string State string // contains filtered or unexported fields }
ItemStateUpdated is sent when the state of an item has been updated.
func NewItemStateUpdated ¶ added in v0.8.0
func NewItemStateUpdated(itemName, stateType, state string) ItemStateUpdated
func (ItemStateUpdated) Topic ¶ added in v0.8.0
func (i ItemStateUpdated) Topic() string
func (ItemStateUpdated) Type ¶ added in v0.8.0
func (i ItemStateUpdated) Type() Type
type ItemUpdated ¶
func NewItemUpdated ¶ added in v0.5.0
func NewItemUpdated(oldItem, newItem Item) ItemUpdated
func (ItemUpdated) Topic ¶
func (i ItemUpdated) Topic() string
func (ItemUpdated) Type ¶
func (i ItemUpdated) Type() Type
type StartlevelEvent ¶ added in v0.8.0
type StartlevelEvent struct {
// contains filtered or unexported fields
}
StartlevelEvent is triggered by the openhab server on startup (typically from 30 to 100). This event was introduced in API version 5.
func NewStartlevelEvent ¶ added in v0.8.0
func NewStartlevelEvent(topic string, startlevel int) StartlevelEvent
func (StartlevelEvent) Level ¶ added in v0.8.0
func (e StartlevelEvent) Level() int
func (StartlevelEvent) Topic ¶ added in v0.8.0
func (e StartlevelEvent) Topic() string
func (StartlevelEvent) Type ¶ added in v0.8.0
func (e StartlevelEvent) Type() Type
type SystemEvent ¶
type SystemEvent struct {
// contains filtered or unexported fields
}
SystemEvent is used for system events not generated by openHAB
func NewSystemEvent ¶
func NewSystemEvent(eventType Type) SystemEvent
NewSystemEvent creates ClientStart, ClientConnected and ClientDisconnected event types
func (SystemEvent) Type ¶
func (e SystemEvent) Type() Type
Type is either ClientStart, ClientConnected, ClientDisconnected or ClientStop
type ThingStatus ¶ added in v0.7.0
type ThingStatusInfoChangedEvent ¶ added in v0.7.0
type ThingStatusInfoChangedEvent struct { ThingName string PreviousStatus string PreviousStatusDetail string PreviousDescription string NewStatus string NewStatusDetail string NewDescription string // contains filtered or unexported fields }
func NewThingStatusInfoChangedEvent ¶ added in v0.7.0
func NewThingStatusInfoChangedEvent(thingName string, previousStatus, newStatus ThingStatus) ThingStatusInfoChangedEvent
NewThingStatusInfoChangedEvent create a ThingStatusInfoChangedEvent.
func (ThingStatusInfoChangedEvent) Topic ¶ added in v0.7.0
func (i ThingStatusInfoChangedEvent) Topic() string
func (ThingStatusInfoChangedEvent) Type ¶ added in v0.7.0
func (i ThingStatusInfoChangedEvent) Type() Type
type ThingStatusInfoEvent ¶ added in v0.7.0
type ThingStatusInfoEvent struct { ThingName string Status string StatusDetail string // contains filtered or unexported fields }
func NewThingStatusInfoEvent ¶ added in v0.7.0
func NewThingStatusInfoEvent(thingName string, status ThingStatus) ThingStatusInfoEvent
NewThingStatusInfoEvent create a ThingStatusInfoEvent.
func (ThingStatusInfoEvent) Topic ¶ added in v0.7.0
func (i ThingStatusInfoEvent) Topic() string
func (ThingStatusInfoEvent) Type ¶ added in v0.7.0
func (i ThingStatusInfoEvent) Type() Type
type ThingUpdated ¶ added in v0.8.0
func NewThingUpdated ¶ added in v0.8.0
func NewThingUpdated(oldThing, newThing Thing) ThingUpdated
func (ThingUpdated) Topic ¶ added in v0.8.0
func (i ThingUpdated) Topic() string
func (ThingUpdated) Type ¶ added in v0.8.0
func (i ThingUpdated) Type() Type
type Type ¶
type Type int
const ( TypeUnknown Type = iota TypeClientStarted TypeClientConnected TypeClientConnectionStable TypeClientDisconnected TypeClientStopped TypeClientError TypeServerAlive // API version >=5 sends ALIVE messages (every 10 seconds) TypeServerStartlevel // API version >=5 sends Startlevel events during startup (typically from 30 to 100) TypeTimeCron // On a specific date and/or time TypeItemAdded // An item has been added to the item registry. TypeItemRemoved // An item has been removed from the item registry. TypeItemUpdated // An item has been updated in the item registry. TypeItemCommand // A command is sent to an item via a channel. TypeItemState // The state of an item is updated. TypeItemStatePredicted // The state of an item predicted to be updated. TypeItemStateChanged // The state of an item has changed. TypeGroupItemStateChanged // The state of a group item has changed through a member. TypeThingAdded // A thing has been added to the thing registry. TypeThingRemoved // A thing has been removed from the thing registry. TypeThingUpdated // A thing has been updated in the thing registry. TypeThingStatusInfo // The status of a thing is updated. TypeThingStatusInfoChanged // The status of a thing changed. TypeInboxAdded // A discovery result has been added to the inbox. TypeInboxRemoved // A discovery result has been removed from the inbox. TypeInboxUpdate // A discovery result has been updated in the inbox. TypeItemChannelLinkAdded // An item channel link has been added to the registry. TypeItemChannelLinkRemoved // An item channel link has been removed from the registry. TypeChannelTriggered // A channel has been triggered. )