cameraapp

package
v11.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package cameraapp demonstrates an app that can send images from a connected webcam to Home Assistant. It exposes the camera entity (through which images are published) as well as start and stop button entities for starting/stopping the camera respectively.

It uses the excellent github.com/vladimirvivien/go4vl package for camera access.

Unfortunately, this example app only runs on Linux.

Index

Constants

This section is empty.

Variables

View Source
var ErrUnsupportedOS = errors.New("example camera app only runs on Linux")

Functions

This section is empty.

Types

type CameraApp

type CameraApp struct {
	// contains filtered or unexported fields
}

CameraApp is our struct that represents an app to Go Hass Anything.

func New

func New(ctx context.Context) (*CameraApp, error)

New sets up our example app. It creates entities for the camera images and start and stop buttons.

func (*CameraApp) Configuration

func (a *CameraApp) Configuration() []*mqttapi.Msg

func (*CameraApp) MsgCh

func (a *CameraApp) MsgCh() chan *mqttapi.Msg

Our channel on which we send camera images as MQTT messages.

func (*CameraApp) Name

func (a *CameraApp) Name() string

func (*CameraApp) States

func (a *CameraApp) States() []*mqttapi.Msg

States is unused in this example app. This could be used to take an image snapshot via the webcam or expose other camera information as entities...

func (*CameraApp) Subscriptions

func (a *CameraApp) Subscriptions() []*mqttapi.Subscription

func (*CameraApp) Update

func (a *CameraApp) Update(_ context.Context) error

Update is unused, there is no app data to update.

Jump to

Keyboard shortcuts

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