Skip to content

feat: add feeding schedule management with dual-hopper support#183

Merged
Jezza34000 merged 4 commits intoJezza34000:mainfrom
ugurhangul:feat/save-feed-schedule
Apr 7, 2026
Merged

feat: add feeding schedule management with dual-hopper support#183
Jezza34000 merged 4 commits intoJezza34000:mainfrom
ugurhangul:feat/save-feed-schedule

Conversation

@ugurhangul
Copy link
Copy Markdown
Contributor

@ugurhangul ugurhangul commented Mar 26, 2026

Summary

Adds native feeding schedule management to the PetKit HA integration with dual-hopper (D4H/D4SH) support.

Changes

  • init.py: Register petkit.set_feeding_schedule HA service with voluptuous schema
  • utils.py: Add get_raw_feed_plan_from_schedule() (fixed-size state, avoids HA 255-char limit) and get_raw_schedule() (per-hopper entity attributes with amount1/amount2)
  • entity.py: Add �xtra_state_attributes callback on PetKitDescSensorBase
  • sensor.py: Wire attributes to RAW distribution data sensor for D4H/D4SH

Dependencies

- Register petkit.set_feeding_schedule HA service with voluptuous validation
- Transform user-friendly YAML into Petkit saveFeed API payload format
- Add services.yaml for HA Actions UI discovery
- Support both single-hopper (amount) and dual-hopper (amount1/amount2) feeders
- Accept time=0 for midnight feeding schedules
@ugurhangul ugurhangul requested a review from Jezza34000 as a code owner March 26, 2026 01:50
@Jezza34000
Copy link
Copy Markdown
Owner

Hi @ugurhangul
Thank you for your PR
I'm testing this on my setup

- Add petkit.set_feeding_schedule HA service with voluptuous schema
- Add get_raw_feed_plan_from_schedule() for 255-char state limit fix
- Add get_raw_schedule() for per-hopper entity attributes (amount1/amount2)
- Add extra_state_attributes callback on PetKitDescSensorBase

Depends on: py-petkit-api SAVE_FEED command (ugurhangul/py-petkit-api#1)
@ugurhangul ugurhangul force-pushed the feat/save-feed-schedule branch from 44dab42 to 22ec6c3 Compare March 26, 2026 17:15
@ugurhangul ugurhangul changed the title feat: add set_feeding_schedule service for Petkit feeders feat: add feeding schedule management with dual-hopper support Mar 26, 2026
@Jezza34000
Copy link
Copy Markdown
Owner

Hi @ugurhangul
Tested on my side it's working OK
Can you fix the CI before i merge ?

@ugurhangul
Copy link
Copy Markdown
Contributor Author

I will on weekend

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Apr 7, 2026

@Jezza34000 Jezza34000 merged commit 41a34d1 into Jezza34000:main Apr 7, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants