Skip to content

Conversation

@zweckj
Copy link
Member

@zweckj zweckj commented Dec 7, 2025

Breaking change

Proposed change

Adding select & number entities to control bbw

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:

@zweckj zweckj marked this pull request as ready for review December 7, 2025 12:24
Copilot AI review requested due to automatic review settings December 7, 2025 12:24
Copy link
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 brew by weight (BBW) controls to the La Marzocco integration, enabling users to configure dose modes and weight targets through Home Assistant.

Key Changes:

  • Added select entity for BBW dose mode selection (continuous, dose1, dose2)
  • Added two number entities for configuring BBW dose weight values (Dose 1 and Dose 2)
  • Enhanced test coverage with comprehensive tests for the new entities

Reviewed changes

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

Show a summary per file
File Description
homeassistant/components/lamarzocco/select.py Added DOSE_MODE_HA_TO_LM mapping constants and new BBW dose mode select entity description with availability check for scale connection
homeassistant/components/lamarzocco/number.py Added two number entity descriptions for BBW dose 1 and dose 2 with weight device class, configurable 5-100g range, and scale connection availability check
homeassistant/components/lamarzocco/strings.json Added translations for BBW entities including entity names and select state options
homeassistant/components/lamarzocco/icons.json Added icons for BBW entities with state-based icons for dose mode select (all-inclusive-box for continuous, numeric boxes for dose1/dose2)
tests/components/lamarzocco/test_select.py Added comprehensive test for BBW dose mode select entity including state verification and service call testing
tests/components/lamarzocco/test_number.py Added parametrized test for both BBW dose number entities with snapshot assertions and service call verification
tests/components/lamarzocco/fixtures/config_mini.json Updated fixture to set scaleConnected to true, enabling BBW entities in tests
tests/components/lamarzocco/snapshots/test_select.ambr Added snapshots for BBW dose mode select entity state and registry entry
tests/components/lamarzocco/snapshots/test_number.ambr Added snapshots for both BBW dose number entities covering state and registry entries

import pytest
from syrupy.assertion import SnapshotAssertion

from homeassistant.components.lamarzocco.select import DOSE_MODE_HA_TO_LM
Copy link

Copilot AI Dec 7, 2025

Choose a reason for hiding this comment

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

The constant DOSE_MODE_HA_TO_LM is being imported from select.py into number.py tests, creating a cross-module dependency. Since this constant is used by both the select and number platforms, it should be moved to const.py to avoid coupling between platform modules. Consider moving both DOSE_MODE_HA_TO_LM and DOSE_MODE_LM_TO_HA from select.py to const.py.

Suggested change
from homeassistant.components.lamarzocco.select import DOSE_MODE_HA_TO_LM
from homeassistant.components.lamarzocco.const import DOSE_MODE_HA_TO_LM

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant