Documentation
¶
Index ¶
- func Handler[T any](handler TypedMessageHandler[T]) mqtt.MessageHandler
- type AddGroup
- type AqaraMotionSensor
- type Binding
- type BridgeStateHandler
- type Cluster
- type CommonDevice
- type ConfigureReporting
- type CoordinatorCheck
- type Definition
- type Device
- type DeviceHandler
- type DeviceIdentifier
- type DeviceUpdate
- type Endpoint
- type Event
- type EventData
- type EventHandler
- type Feature
- type GroupMembers
- type GroupOptions
- type HealthCheck
- type InstallCode
- type InterviewDevice
- type LogMessage
- type LoggingHandler
- type PermitJoinCommand
- type RemoveDevice
- type RemoveGroup
- type RenameDevice
- type RenameGroup
- type Reporting
- type Request
- type Response
- type Scene
- type SetGroupOptions
- type SonoffContactSensor
- type SonoffTemperatureSensor
- type State
- type Target
- type TelemHandler
- type ThirdRealityMotionSensor
- type TypedMessageHandler
- type Zigbee
- func (z *Zigbee) AddGroup(id int, name string) error
- func (z *Zigbee) AddGroupMembers(group, device string) error
- func (z *Zigbee) ConfigureReporting(id, cluster, attribute string, minInterval, maxInterval time.Duration, ...) error
- func (z *Zigbee) CoordinatorCheck() (CoordinatorCheck, error)
- func (z *Zigbee) HealthCheck() (HealthCheck, error)
- func (z *Zigbee) InstallCode(code string) error
- func (z *Zigbee) InterviewDevice(id string) error
- func (z *Zigbee) PermitJoin() error
- func (z *Zigbee) PermitJoinFor(dur time.Duration) error
- func (z *Zigbee) ProhibitJoin() error
- func (z *Zigbee) RemoveAllGroupMembers(device string) error
- func (z *Zigbee) RemoveDevice(id string) error
- func (z *Zigbee) RemoveGroup(id any) error
- func (z *Zigbee) RemoveGroupMembers(group, device string) error
- func (z *Zigbee) RenameDevice(id, name string) error
- func (z *Zigbee) RenameGroup(id any, name string) error
- func (z *Zigbee) Restart() error
- func (z *Zigbee) SetGroupOptions(id any, opts GroupOptions) (SetGroupOptions, error)
- func (z *Zigbee) SetOption(device string, obj any) error
- func (z *Zigbee) Updates() <-chan DeviceUpdate
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Handler ¶
func Handler[T any](handler TypedMessageHandler[T]) mqtt.MessageHandler
Types ¶
type AqaraMotionSensor ¶
type AqaraMotionSensor struct {
CommonDevice
Occupancy bool `json:"occupancy"`
TriggerIndicator bool `json:"trigger_indicator"`
MotionSensitity string `json:"motion_sensitivity"`
DetectionInterval float64 `json:"detection_interval"`
TemperatureC float64 `json:"device_temperature"`
Illuminance float64 `json:"illuminance"`
PowerOutageCount int `json:"power_outage_count"`
}
type BridgeStateHandler ¶
type CommonDevice ¶
type ConfigureReporting ¶
type CoordinatorCheck ¶
type CoordinatorCheck struct {
MissingRouters []DeviceIdentifier `json:"missing_routers"`
}
type Definition ¶
type Device ¶
type Device struct {
DeviceIdentifier
Type string `json:"type"`
Manufacturer string `json:"manufacturer"`
ModelID string `json:"model_id"`
NetworkAddress int `json:"network_address"`
Description string `json:"description"`
Endpoints map[string]Endpoint `json:"endpoints"`
Definition *Definition `json:"definition"`
PowerSource string `json:"power_source"`
DateCode string `json:"date_code"`
Scenes []Scene `json:"scene"`
Interviewing bool `json:"interviewing"`
InterviewCompleted bool `json:"interview_completed"`
Supported bool `json:"supported"`
Disabled bool `json:"disabled"`
// contains filtered or unexported fields
}
type DeviceHandler ¶
type DeviceIdentifier ¶
type DeviceUpdate ¶
type EventData ¶
type EventData struct {
FriendlyName string `json:"friendly_name"`
IEEEAddress string `json:"ieee_address"`
Status *string `json:"status"`
Supported *bool `json:"supported"`
Definition *Definition `json:"definition"`
}
type EventHandler ¶
type Feature ¶
type Feature struct {
Access int `json:"access"`
Category string `json:"category"`
Description string `json:"description"`
Label string `json:"label"`
Name string `json:"name"`
Property string `json:"property"`
Type string `json:"type"`
Unit string `json:"unit"`
ValueOn any `json:"value_on"`
ValueOff any `json:"value_off"`
ValueMin *float64 `json:"value_min"`
ValueMax *float64 `json:"value_max"`
Values []string `json:"values"`
Features []*Feature `json:"features"`
ItemType *Feature `json:"item_type"`
}
type GroupMembers ¶
type GroupOptions ¶
type HealthCheck ¶
type HealthCheck struct {
Healthy bool `json:"healthy"`
}
type InstallCode ¶
type InstallCode struct {
Value string `json:"value"`
}
type InterviewDevice ¶
type InterviewDevice struct {
ID string `json:"id"`
}
type LogMessage ¶
type LoggingHandler ¶
type PermitJoinCommand ¶
type RemoveDevice ¶
type RemoveGroup ¶
type RemoveGroup struct {
ID any `json:"id"`
}
type RenameDevice ¶
type RenameGroup ¶
type Request ¶
func (Request) MarshalJSON ¶
type Response ¶
type Response struct {
Data json.RawMessage `json:"data"`
Transaction int64 `json:"transaction"`
Status *string `json:"status"`
}
type SetGroupOptions ¶
type SetGroupOptions struct {
ID any `json:"id"`
Options *GroupOptions `json:"options,omitempty"`
From *GroupOptions `json:"from,omitempty"`
To *GroupOptions `json:"to,omitempty"`
}
type SonoffContactSensor ¶
type SonoffContactSensor struct {
CommonDevice
Contact bool `json:"contact"`
Tamper bool `json:"contact"`
BatteryLow bool `json:"battery_low"`
}
type SonoffTemperatureSensor ¶
type SonoffTemperatureSensor struct {
CommonDevice
Humidity float64 `json:"humidity"`
TemperatureC float64 `json:"temperature"`
}
type TelemHandler ¶
type TelemHandler func(dev *Device, telem json.RawMessage) error
func TypedTelemHandler ¶
func TypedTelemHandler[T any](handler func(*Device, T) error) TelemHandler
type ThirdRealityMotionSensor ¶
type ThirdRealityMotionSensor struct {
CommonDevice
Occupancy bool `json:"occupancy"`
Tamper bool `json:"tamper"`
BatteryLow bool `json:"battery_low"`
}
type TypedMessageHandler ¶
type Zigbee ¶
type Zigbee struct {
// contains filtered or unexported fields
}
func (*Zigbee) AddGroupMembers ¶
func (*Zigbee) ConfigureReporting ¶
func (*Zigbee) CoordinatorCheck ¶
func (z *Zigbee) CoordinatorCheck() (CoordinatorCheck, error)
func (*Zigbee) HealthCheck ¶
func (z *Zigbee) HealthCheck() (HealthCheck, error)
func (*Zigbee) InstallCode ¶
func (*Zigbee) InterviewDevice ¶
func (*Zigbee) PermitJoin ¶
func (*Zigbee) ProhibitJoin ¶
func (*Zigbee) RemoveAllGroupMembers ¶
func (*Zigbee) RemoveDevice ¶
func (*Zigbee) RemoveGroup ¶
func (*Zigbee) RemoveGroupMembers ¶
func (*Zigbee) RenameDevice ¶
func (*Zigbee) SetGroupOptions ¶
func (z *Zigbee) SetGroupOptions(id any, opts GroupOptions) (SetGroupOptions, error)
func (*Zigbee) Updates ¶
func (z *Zigbee) Updates() <-chan DeviceUpdate
Click to show internal directories.
Click to hide internal directories.