Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MarshalSensorRegistration ¶
func MarshalSensorRegistration(s Sensor) *sensorRegistrationInfo
func MarshalSensorUpdate ¶
func MarshalSensorUpdate(s Sensor) *sensorUpdateInfo
Types ¶
type ComparableStringer ¶
type ComparableStringer interface { comparable String() string }
type Sensor ¶
type Sensor interface { Name() string ID() string Icon() string SensorType() sensorType.SensorType DeviceClass() deviceClass.SensorDeviceClass StateClass() stateClass.SensorStateClass State() interface{} Units() string Category() string Attributes() interface{} }
Sensor represents an update for a sensor. It reflects the current state of the sensor at the point in time it is used. It provides a bridge between platform/device and HA implementations of what a sensor is.
type SensorMetadata ¶
type SensorTracker ¶
type SensorTracker struct {
// contains filtered or unexported fields
}
func NewSensorTracker ¶
func NewSensorTracker(ctx context.Context, path string) *SensorTracker
func (*SensorTracker) Get ¶
func (tracker *SensorTracker) Get(id string) (sensorState, error)
Get fetches a sensors current tracked state
func (*SensorTracker) StartWorkers ¶
func (tracker *SensorTracker) StartWorkers(ctx context.Context, updateCh chan interface{})
StartWorkers will call all the sensor worker functions that have been defined for this device.
Click to show internal directories.
Click to hide internal directories.