Skip to content

Add new Mealie meal plan types to calendar and services#158987

Merged
joostlek merged 3 commits into
home-assistant:devfrom
andrew-codechimp:mealie-new-calendars
Dec 15, 2025
Merged

Add new Mealie meal plan types to calendar and services#158987
joostlek merged 3 commits into
home-assistant:devfrom
andrew-codechimp:mealie-new-calendars

Conversation

@andrew-codechimp
Copy link
Copy Markdown
Contributor

@andrew-codechimp andrew-codechimp commented Dec 14, 2025

Proposed change

Mealie 3.7 introduced new meal plan types. This PR adds support for these with backward compatibility with older versions.

Calendar - checks the Mealie version and only creates calendar entities supported by the version.

Services - Adds the meal plan types to the two services that add meals, with a version check and a service validation error being raised if trying to use the new meal plan types with older versions.

Mealie has nightly versions, which are un-versioned, we already have a warning that nightly is not supported and assume that they are running the latest version if this is the case.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Checklist

  • I understand the code I am submitting and can explain how it works.
  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • I have followed the perfect PR recommendations
  • The code has been formatted using Ruff (ruff format homeassistant tests)
  • Tests have been added to verify that the new code works.
  • Any generated code has been carefully reviewed for correctness and compliance with project standards.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.

To help with the load of incoming pull requests:

@home-assistant
Copy link
Copy Markdown
Contributor

Hey there @joostlek, mind taking a look at this pull request as it has been labeled with an integration (mealie) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of mealie can trigger bot actions by commenting:

  • @home-assistant close Closes the pull request.
  • @home-assistant rename Awesome new title Renames the pull request.
  • @home-assistant reopen Reopen the pull request.
  • @home-assistant unassign mealie Removes the current integration label and assignees on the pull request, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the pull request.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the pull request.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds support for three new meal plan types (dessert, drink, snack) introduced in Mealie 3.7, while maintaining backward compatibility with earlier versions. The implementation includes version checking to conditionally create calendar entities and validate service calls based on the Mealie server version.

Key Changes

  • Version-based validation ensures new meal plan types are only used with Mealie 3.7+
  • Calendar entities are dynamically created based on server version
  • Service calls validate meal plan types against the server version

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
homeassistant/components/mealie/__init__.py Passes version information to runtime_data for use in other components
homeassistant/components/mealie/coordinator.py Adds version field to MealieData dataclass
homeassistant/components/mealie/calendar.py Conditionally creates calendar entities based on Mealie version
homeassistant/components/mealie/services.py Adds validation function to check meal plan types against version
homeassistant/components/mealie/services.yaml Adds new meal plan type options (dessert, snack, drink) to service definitions
homeassistant/components/mealie/strings.json Adds translations for new meal plan types and validation error message
tests/components/mealie/test_calendar.py Adds test for legacy calendar behavior on Mealie < 3.7
tests/components/mealie/test_services.py Adds parametrized tests for version-based service validation
tests/components/mealie/fixtures/about.json Updates default test version to v3.7.0
tests/components/mealie/snapshots/*.ambr Updates test snapshots for new entities and version

Comment thread homeassistant/components/mealie/services.py Outdated
@andrew-codechimp andrew-codechimp marked this pull request as draft December 14, 2025 13:35
@andrew-codechimp andrew-codechimp marked this pull request as ready for review December 14, 2025 14:25
@joostlek joostlek merged commit 3e1f9de into home-assistant:dev Dec 15, 2025
32 checks passed
@andrew-codechimp andrew-codechimp deleted the mealie-new-calendars branch December 15, 2025 16:25
@github-actions github-actions Bot locked and limited conversation to collaborators Dec 16, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants