ds18b20

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2022 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Overview

Package ds18b20 implements a 1-wire temperature sensor

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AttrConfig

type AttrConfig struct {
	UniqueID string `json:"unique_id"`
}

AttrConfig is used for converting config attributes.

type Sensor

type Sensor struct {
	Name          string
	OneWireID     string
	OneWireFamily string
	generic.Unimplemented
}

Sensor is a 1-wire Sensor device.

func (*Sensor) ReadTemperatureCelsius

func (s *Sensor) ReadTemperatureCelsius(ctx context.Context) (float64, error)

ReadTemperatureCelsius returns current temperature in celsius.

func (*Sensor) Readings

func (s *Sensor) Readings(ctx context.Context) (map[string]interface{}, error)

Readings returns a list containing single item (current temperature).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL