ds18b20

package
v0.14.0-rc0 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2023 License: AGPL-3.0 Imports: 11 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 Config added in v0.2.36

type Config struct {
	resource.TriviallyValidateConfig
	UniqueID string `json:"unique_id"`
}

Config is used for converting config attributes.

type Sensor

type Sensor struct {
	resource.Named
	resource.AlwaysRebuild
	resource.TriviallyCloseable
	OneWireID     string
	OneWireFamily string
	// contains filtered or unexported fields
}

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, extra map[string]interface{}) (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