Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // "3V_2100" in zigbee2mqtt terminology BatteryCR2032 = &hubtypes.BatteryType{func(voltage float64) float64 { return float64(func() float64 { voltage := float64(voltage * 1000) switch { case voltage < 2100: return 0 case voltage < 2440: return 6 - ((2440-voltage)*6)/340 case voltage < 2740: return 18 - ((2740-voltage)*12)/300 case voltage < 2900: return 42 - ((2900-voltage)*24)/160 case voltage < 3000: return 100 - ((3000-voltage)*58)/100 default: return 100 } }()) / 100 }} )
Functions ¶
func AttributeReportToAttributes ¶
func AttributeReportToAttributes( report *cluster.AttributeReport, clusterId cluster.ClusterId, dev *ezstack.Device, adapter Adapter, actx *hubtypes.AttrsCtx, ) error
parses Zigbee AttributeReport message into structured sane attributes, taking into account manufacturer-specific "peculiarities"...
func ZclIncomingMessageToAttributes ¶
func ZclIncomingMessageToAttributes( message *zcl.ZclIncomingMessage, actx *hubtypes.AttrsCtx, device *ezstack.Device, ) error
updates attributes from ReportAttributesCommand/ZoneStatusChangeNotificationCommand/etc.
Types ¶
type Adapter ¶
type Adapter interface { // given "genOnOff.onOff", returns parser for it ParserForAttribute(clusterAndAttribute string) customParser // handle any additional (non-AttributeReport) commands HandleCommand(command interface{}, actx *hubtypes.AttrsCtx) error // returns nil if not battery powered BatteryType() *hubtypes.BatteryType }
func AdapterForModel ¶
type Attribute ¶
type Attribute struct { Id uint8 Attribute *zcl.AttributeDataTypeValue }
type AttributeList ¶
type AttributeList []Attribute
func ParseAttributeList ¶
func ParseAttributeList(xiaomiBytes []byte) (AttributeList, error)
func (AttributeList) Find ¶
func (a AttributeList) Find(id uint8) *zcl.AttributeDataTypeValue
Source Files
¶
Click to show internal directories.
Click to hide internal directories.