automoli-go

command module
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2024 License: MIT Imports: 5 Imported by: 0

README

automoli

Go Report Card Go Reference GitHub Workflow Status No Maintenance Intended

Fully automatic light management based on motion, daytime, brightness and even humidity 💦 🚿

🕓 multiple daytimes to define different scenes for morning, noon, ...
💡 supports Hue (for Hue Rooms/Groups) & Home Assistant scenes
🔌 switches lights and plugs (with lights)
☀️ supports illumination sensors to switch the light just if needed
💦 supports humidity sensors as blocker (the "shower case")
🔒 locks the light if the light was manually turned on

- successor of the famous original ad-AutoMoLi (written in Python as AppDaemon plugin/app) -

install

via go install

go install github.com/benleb/automoli-go@latest

run

see the example config for a multi-room configuration with different daytimes and sensors and settings.

# run
automoli-go run --config ~/automoli.yaml

# more options
automoli-go --help
systemd service example

this is an example how the systemd service file can be used for running AutoMoLi as a service. uuser, group and repo/config directory may need to be adjusted.

# clone repo
git clone https://github.com/benleb/automoli-go ~/automoli

# create a new user and group for automoli
useradd --system --home-dir /etc/automoli --user-group automoli

# create config directory and set permissions
mkdir /etc/automoli && chown automoli:automoli /etc/automoli

# link or copy the systemd service file
ln -s ~/automoli/automoli.service /etc/systemd/system/automoli.service

build

single target
# build for current platform
goreleaser build --clean --snapshot --single-target

# build for specific platform
GOOS="linux" GOARCH="amd64" GOAMD64="v3" goreleaser build --clean --snapshot --single-target
docker image

with ko

# build image and push to registry
KO_DOCKER_REPO=your.registry.io:5000 ko build --verbose --base-import-paths --tags dev

development

lint

with golangci-lint

# run all linters
golangci-lint run --verbose --enable-all --fix --max-issues-per-linter 0 --max-same-issues 0
tests
# run tests with coverage
go test -cover ./...
release/tag

vith goreleaser triggered by a git tag

# create a new annotated tag
git tag -a "vX.Y.Z" -m "short release description vX.Y.Z"
# push tag to trigger the release workflow
git push --follow-tags

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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