Skip to content

Feature/pets management - #204

Merged
jjjonesjr33 merged 4 commits into
jjjonesjr33:devfrom
FeliGoblin:feature/pets-management
Mar 27, 2026
Merged

Feature/pets management#204
jjjonesjr33 merged 4 commits into
jjjonesjr33:devfrom
FeliGoblin:feature/pets-management

Conversation

@FeliGoblin

Copy link
Copy Markdown
Contributor

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.
Screenshot_1

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.
Screenshot_3

Extra attributes:

Screenshot_5 Screenshot_6

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.
Screenshot_7

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

A pet with a custom breed and no avatar assigned:

Screenshot_10 Screenshot_11

Closes #203 (issue)

Type of change:

  • New device.
  • Bug fix (non-breaking change which fixes an issue).
  • New feature or enhancement (non-breaking change which adds functionality).
  • Documentation only.
  • Other (please explain).

Checklist:

  • If applicable, I have added corresponding documentation changes.
  • If applicable, I have reviewed the feature / enhancement guidlines before submitting my request.
  • If applicable, I have tested my code for new features & regressions on the latest version of Home Assistant.

Additional notes:

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.

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/detailv2 API call like they do for food.

FeliGoblin and others added 4 commits March 17, 2026 17:25
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.
@jjjonesjr33 jjjonesjr33 self-assigned this Mar 27, 2026
@jjjonesjr33 jjjonesjr33 added the Enhancement New feature or request label Mar 27, 2026
@github-project-automation github-project-automation Bot moved this to To triage in Petlibro Mar 27, 2026
@jjjonesjr33
jjjonesjr33 self-requested a review March 27, 2026 00:07

@jjjonesjr33 jjjonesjr33 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's give it a try, will release as a pre-release to run tests on. Great work @FeliGoblin

@github-project-automation github-project-automation Bot moved this from To triage to In review in Petlibro Mar 27, 2026
@jjjonesjr33
jjjonesjr33 merged commit 70f211c into jjjonesjr33:dev Mar 27, 2026
2 checks passed
@github-project-automation github-project-automation Bot moved this from In review to Done in Petlibro Mar 27, 2026
@jjjonesjr33 jjjonesjr33 added the Completed Completed tasks label Aug 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Completed Completed tasks Enhancement New feature or request

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[Feature Request]: Pets Management

2 participants