Skip to content

booysenn/py-opensprinkler

This branch is 7 commits behind vinteo/py-opensprinkler:refs/heads/master.

Folders and files

NameName
Last commit message
Last commit date
Aug 2, 2024
Sep 19, 2024
Sep 19, 2024
Jul 21, 2023
May 25, 2020
Apr 3, 2023
Apr 12, 2020
Oct 6, 2023
Oct 3, 2020
Feb 26, 2021
Apr 27, 2020
May 25, 2020
Aug 2, 2024

Repository files navigation

Python module for OpenSprinker API

PyPI version PyPI - Downloads Linting Status Build Status CodeQL Quality Gate Status codecov

Tested against OpenSprinkler version 2.1.9.

Installation

pip install pyopensprinkler

Usage

from pyopensprinkler import Controller as OpenSprinklerController

controller = OpenSprinklerController("http[s]://hostname[:port]", "password")
await controller.refresh()

version = controller.firmware_version

Commands and Properties

All commands are async.

Controller

controller.refresh() Refreshes state, programs and stations

controller.enable() Enabled controller operation

controller.disable() Disables controller operation

controller.programs

controller.stations

Programs

is_enabled = controller.programs[0].enabled

program = controller.programs[0]
await program.run()

program.enabled

program.enable()

program.disable()

program.run()

Stations

is_enabled = controller.stations[0].enabled
status = controller.stations[0].status
station = controller.station[0]
await station.run(120)

station.is_running

station.running_program_id

station.status

station.run(seconds) Acceptable range for seconds is 0 to 64800 (18 hours)

station.stop()

station.toggle()

Development

OpenSprinkler API documentation available here.

virtualenv .
source bin/activate

# install requirements
pip install -r requirements.txt

# install dev requirements
pip install -r requirements-dev.txt

# one-time install commit hooks
pre-commit install

deactivate

About

Python module for OpenSprinker API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%