Skip to content

Commit 20180b9

Browse files
authored
Remove python_scripts, replaced with valve attributes next_start_time and next_start_programs (#400)
The bundled python_scripts were flagged as experimental and unsupported, and the next-watering calculation only partially covered Orbit's scheduling modes (see #180). Remove the scripts, the related README sections, and stale references in .ruff.toml and CLAUDE.md.
1 parent d3f1bd2 commit 20180b9

5 files changed

Lines changed: 2 additions & 263 deletions

File tree

.ruff.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ ignore = [
1414
"PLR0913",
1515
]
1616

17-
exclude = ["python_scripts/*", "debug/*"]
17+
exclude = ["debug/*"]
1818

1919
[lint.per-file-ignores]
2020
"tests/*" = [

CLAUDE.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ This is a Home Assistant custom integration for Orbit B-hyve irrigation devices.
3434
- `custom_components/bhyve/__init__.py` - Integration setup and coordinator
3535
- `custom_components/bhyve/pybhyve/` - B-hyve API client library
3636
- `config/` - Home Assistant configuration for development
37-
- `python_scripts/` - Experimental utility scripts for calculating watering schedules
3837

3938
### Key Components
4039
- **API Client**: `pybhyve/client.py` - Handles authentication and API communication

README.md

Lines changed: 1 addition & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ A **zone** `valve` entity is created for each zone of a `sprinkler_timer` device
128128

129129
The default run time is often indicated by the `manual_preset_runtime` attribute, and this can be set using the `set_manual_preset_runtime` service or configured in the B-hyve app.
130130

131-
> [!NOTE]
131+
> [!NOTE]
132132
> Some BHyve devices do not have the ability to set the default watering time, and it is recommended that you use the `bhyve.start_watering` service to start the watering zone with the desired number of minutes.
133133
134134
The following attributes are set on zone valve entities:
@@ -243,63 +243,3 @@ The `frequency` object mirrors the B-Hyve API structure. Known `type` values:
243243

244244
The `budget` is a percentage that scales each zone's run time. `100` means unchanged, `50` halves every run time, `200` doubles it. Valid range is 0–200.
245245

246-
## Python Script
247-
248-
> [!CAUTION]
249-
> These scripts are expermintal and not supported. YMMV and any support issues will be closed as won't fix.
250-
251-
Bundled in this repository is a [`python_script`](https://www.home-assistant.io/integrations/python_script) which calculates a device's next watering time and when a rain delay is scheduled to finish.
252-
253-
_Note: HACS does not install the script automatically and they must be added manually to your HA instance._
254-
255-
### Scripts
256-
257-
#### [`bhyve_next_watering.py`](https://github.com/sebr/bhyve-home-assistant/blob/master/python_scripts/bhyve_next_watering.py)
258-
259-
Calculates:
260-
261-
1. When the next scheduled watering is for a zone by considering all enabled watering programs
262-
2. When a device's active rain delay will finish, or `None` if there is no active delay
263-
264-
This script creates or updates entities named `sensor.{zone_name}_next_watering` and `sensor.{device_name}_rain_delay_finishing`.
265-
266-
Usage:
267-
268-
```yaml
269-
service: python_script.bhyve_next_watering
270-
data:
271-
entity_id: valve.backyard_zone
272-
```
273-
274-
| Argument | Type | Required | Notes |
275-
| ----------- | -------- | -------- | ------------------------------- |
276-
| `entity_id` | `string` | `True` | The entity id for a zone valve. |
277-
278-
### Automation
279-
280-
Hook these scripts up to automations to update as required:
281-
282-
```yaml
283-
automation:
284-
- alias: B-hyve next watering & rain delay finishing updater
285-
trigger:
286-
- platform: state
287-
entity_id: valve.backyard_zone, switch.rain_delay_lawn
288-
- platform: homeassistant
289-
event: start
290-
action:
291-
- service: python_script.bhyve_next_watering
292-
data:
293-
entity_id: valve.backyard_zone
294-
```
295-
296-
## Debugging
297-
298-
To debug this integration and provide device integration for future improvements, please enable debugging in Home Assistant's `configuration.yaml`
299-
300-
```yaml
301-
logger:
302-
logs:
303-
custom_components.bhyve: debug
304-
pybhyve: debug
305-
```

python_scripts/bhyve_next_watering.py

Lines changed: 0 additions & 115 deletions
This file was deleted.

python_scripts/test/test_next_watering.py

Lines changed: 0 additions & 85 deletions
This file was deleted.

0 commit comments

Comments
 (0)