Feature/pets management - #204
Merged
Merged
Conversation
Changes:
Replaced uses of 'datetime.utcnow()' (deprecated) with homeassistant.util.dt.utcnow()
Moved the 'PetlibroHub.loaded_device_sn' set to the DevicesHelper.
Moved the 'PetlibroHub.feed_number_unique_ids' and 'PetlibroHub.unit_entities_unique_ids' dicts to the Unit_Entities helper.
Changed 'PetlibroHub.devices' to a dictionary with serial numbers as keys.
New:
Device serial numbers, device IDs and owned/shared status gets saved to Config Entry options.
Pet IDs, pet device IDs and owned/shared status gets saved to Config Entry options.
Added DevicesHelper.
Added PetsHelper.
Devices and Pets removed from the Petlibro account will be removed from the integration automatically.
Added 'media' directory for images etc.
Added option to Integration Settings:
Show Pets from Shared Devices
Added entity platforms:
date
image
Added methods to API:
device_get_bound_pets
pets.get_list
pets.get_details
pets.get_bound_devices
pets.save_or_update
pets.goal_setting
Added Pet object and pet devices with entities.
…in/petlibro into feature/pets-management Litterbox merge
jjjonesjr33
approved these changes
Mar 27, 2026
jjjonesjr33
left a comment
Owner
There was a problem hiding this comment.
Let's give it a try, will release as a pre-release to run tests on. Great work @FeliGoblin
This was referenced Mar 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed change:
Adds pets to the integration!
Each pet is represented as a device with its own entities.
This includes pets created on the account that's signed in, as well as any pets from other account(s) that are linked/bound to any of your devices, including ones that are shared with you, by default. The inclusion of "shared pets" can be disabled in the integration settings.
It’s fairly simple for now, focusing on establishing the core structure. Future PRs will add support for creating and deleting pets, assigning them to devices, managing collars, etc.
Pets as devices:
Pets are added as a "service" type to visually differentiate them from actual devices, but this doesn't effect functionality at all from what I can tell.

Entities:
The Configuration input entities will update those details through the API.

"Shared pets" (pets from other accounts), can also be updated like this. I can't imagine they intended for people to be able to modify other people's pet's settings so I would argue this is an exploit of their API. So, I don't know if this is something we want to keep? It's also entirely possible this will be patched out in the future, whether that means pets from other accounts will be read-only or completely blocked I can't say.
Extra attributes:
The 'Linked Devices' entity includes the corresponding device entry IDs from your own Home Assistant, I imagine that could be handy for some creative automations.

The main pet entity includes some variables in their raw form, maybe someone could find some use for them, maybe not. 🤷♀️


A pet with a custom breed and no avatar assigned:
Closes #203 (issue)
Type of change:
Checklist:
Additional notes:
Changes:
New:
I showed an option called "Include non-RFID Pet Consumption" in the issue post, I've removed it for now until I properly figure out how best to implement water intake as well as food, since they don't include RFID water intake in the
member/pet/detailv2API call like they do for food.