Skip to content

Conversation

@magnusoverli
Copy link

@magnusoverli magnusoverli commented Nov 3, 2025

Breaking change

⚠️ The fireplace mode switch is deprecated (but not removed yet)

The fireplace mode switch entity has been deprecated and disabled by default. It will be removed in a future version. Users with existing automations can continue using it, but will receive a repair notification prompting them to migrate to the climate preset.

For users with existing fireplace switch automations:

A repair issue will guide you to update your automations:

Before (deprecated):

service: switch.turn_on
target:
  entity_id: switch.flexit_nordic_fireplace_mode

After (recommended):

service: climate.set_preset_mode
target:
  entity_id: climate.flexit_nordic
data:
  preset_mode: fireplace

Additionally, the "Boost" preset has been renamed to "High" to match the device's terminology.

Proposed change

This PR converts the fireplace mode in the flexit_bacnet integration from a switch entity to a proper climate preset mode, matching how it appears on the physical Flexit device. It also renames the "Boost" preset to "High" to align with device terminology.

Problem: The fireplace mode was implemented as a switch entity, but on the physical Flexit device it functions as a ventilation mode just like "Home", "Away", and "High" (previously "Boost"). This inconsistency made it less intuitive for users and didn't match the device's actual interface.

Solution:

  • Renamed preset: Changed "Boost" → "High" to match device labeling
  • Converted fireplace mode: Changed from switch.flexit_nordic_fireplace_mode to a climate preset
  • Added proper UI elements: Translations and icons for all preset modes
  • Technical implementation: Uses operation_mode property to detect fireplace state (which correctly reports OPERATION_MODE_FIREPLACE when active)
  • Preserved functionality: Fireplace mode retains its automatic timeout behavior
  • Smooth migration: Fireplace switch is deprecated (disabled by default) rather than removed, with repair notifications to guide users
  • Fixed preset switching: Properly exits fireplace mode when switching to other presets by toggling it off before setting new ventilation mode
  • Fixed deprecation warning: Repair issue now appears immediately on integration load if switch is enabled

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

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:
  • Link to documentation pull request:
  • Link to developer documentation pull request:
  • Link to frontend pull request:

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:

…' preset to 'High' to match device terminology- Convert fireplace mode from switch entity to climate preset- Add translations and icons for all preset modes- Use operation_mode for accurate fireplace state detection
@home-assistant
Copy link

home-assistant bot commented Nov 3, 2025

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

Code owner commands

Code owners of flexit_bacnet 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 flexit_bacnet 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
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 refactors the Flexit BACnet integration to consolidate fireplace mode from a separate switch entity into a climate preset mode. The main changes involve migrating from using ventilation_mode to operation_mode for reading device state, adding fireplace as a climate preset, and updating preset names for better clarity.

Key changes:

  • Replaces "boost" preset with "high" and adds "fireplace" as climate presets
  • Removes fireplace mode switch entity and moves functionality to climate preset
  • Changes climate entity to read state from operation_mode instead of ventilation_mode

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
homeassistant/components/flexit_bacnet/climate.py Updates climate entity to use operation_mode for state, adds fireplace preset handling, renames boost to high
homeassistant/components/flexit_bacnet/const.py Adds operation mode constants and mappings, replaces boost with high preset, removes ventilation-to-preset mapping
homeassistant/components/flexit_bacnet/switch.py Removes fireplace mode switch entity definition
homeassistant/components/flexit_bacnet/strings.json Adds climate preset translations, removes fireplace switch translation
homeassistant/components/flexit_bacnet/icons.json Adds climate preset icons, removes fireplace switch icons
tests/components/flexit_bacnet/conftest.py Adds operation_mode initialization to mock device
tests/components/flexit_bacnet/test_climate.py Updates tests to set both ventilation_mode and operation_mode on mock
tests/components/flexit_bacnet/snapshots/test_climate.ambr Updates snapshots for renamed presets and added translation key
tests/components/flexit_bacnet/snapshots/test_switch.ambr Removes fireplace mode switch snapshots

Comment on lines +22 to +23
PRESET_HIGH = "high"
PRESET_FIREPLACE = "fireplace"
Copy link

Copilot AI Nov 3, 2025

Choose a reason for hiding this comment

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

These custom preset constants should include docstring comments explaining their purpose and when they're used, following Home Assistant's documentation standards for public constants.

Copilot uses AI. Check for mistakes.
Copy link
Author

Choose a reason for hiding this comment

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

@copilot open a new pull request to apply changes based on this feedback

Requires ClimateEntityFeature.PRESET_MODE.
"""
return VENTILATION_TO_PRESET_MODE_MAP[self.device.ventilation_mode]
return OPERATION_TO_PRESET_MODE_MAP.get(self.device.operation_mode, PRESET_HOME)
Copy link

Copilot AI Nov 3, 2025

Choose a reason for hiding this comment

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

Using PRESET_HOME as a default fallback could mask issues when an unknown operation mode is encountered. Consider logging a warning when falling back to the default, or using PRESET_NONE as a more neutral fallback to indicate an unknown state.

Copilot uses AI. Check for mistakes.
Copy link
Author

Choose a reason for hiding this comment

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

@copilot open a new pull request to apply changes based on this feedback

- Keep fireplace mode switch but disable it by default
- Add deprecation warning when switch is used
- Direct users to use climate preset mode instead
- Provides smoother migration path for existing users
@magnusoverli magnusoverli force-pushed the flexit-fireplace-preset branch from cd29eef to 8ebef4d Compare November 3, 2025 21:20
@lellky
Copy link
Contributor

lellky commented Nov 4, 2025

Good job!

But, I have checked out your code and when running it I locally I found that it does not work properly.

Changing preset to Fireplace using the card for the hvac entity works. But when trying to change back to any other preset does not work.

Also I see no warning or repair issue risen when using the (now) deprecated switch.

- Fix: Switching from fireplace preset to other presets now works correctly
  - When in fireplace mode, toggle it off before setting a new ventilation mode
  - trigger_fireplace_mode() acts as a toggle, so calling it while active turns it off
- Fix: Deprecation warning now appears on integration load if fireplace switch is enabled
  - Previously only showed when switch was actively used
  - Now creates repair issue in async_setup_entry if switch is enabled
- Add missing mock properties (fireplace_ventilation_status, cooker_hood_status) to conftest
- Update snapshots to reflect correct fireplace switch state
@magnusoverli
Copy link
Author

Good job!

But, I have checked out your code and when running it I locally I found that it does not work properly.

Changing preset to Fireplace using the card for the hvac entity works. But when trying to change back to any other preset does not work.

Also I see no warning or repair issue risen when using the (now) deprecated switch.

Thanks for the feedback! 👍

I've tried addressing the issues you brought to light. I have tested with my device locally and changing away from Fireplace-mode now works in the card.

@lellky
Copy link
Contributor

lellky commented Nov 4, 2025

Thanks for the feedback! 👍

I've tried addressing the issues you brought to light. I have tested with my device locally and changing away from Fireplace-mode now works in the card.

I can verify that you latest change works; the repair issue is risen and switching presets works. Great!

Copy link
Contributor

@lellky lellky left a comment

Choose a reason for hiding this comment

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

Looks good to me!

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.

3 participants