-
-
Notifications
You must be signed in to change notification settings - Fork 35.8k
Convert flexit_bacnet fireplace mode to climate preset- Rename 'Boost… #155760
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,34 +1,40 @@ | ||
| """Constants for the Flexit Nordic (BACnet) integration.""" | ||
|
|
||
| from flexit_bacnet import ( | ||
| OPERATION_MODE_AWAY, | ||
| OPERATION_MODE_FIREPLACE, | ||
| OPERATION_MODE_HIGH, | ||
| OPERATION_MODE_HOME, | ||
| OPERATION_MODE_OFF, | ||
| VENTILATION_MODE_AWAY, | ||
| VENTILATION_MODE_HIGH, | ||
| VENTILATION_MODE_HOME, | ||
| VENTILATION_MODE_STOP, | ||
| ) | ||
|
|
||
| from homeassistant.components.climate import ( | ||
| PRESET_AWAY, | ||
| PRESET_BOOST, | ||
| PRESET_HOME, | ||
| PRESET_NONE, | ||
| ) | ||
| from homeassistant.components.climate import PRESET_AWAY, PRESET_HOME, PRESET_NONE | ||
|
|
||
| DOMAIN = "flexit_bacnet" | ||
|
|
||
| MAX_TEMP = 30 | ||
| MIN_TEMP = 10 | ||
|
|
||
| VENTILATION_TO_PRESET_MODE_MAP = { | ||
| VENTILATION_MODE_STOP: PRESET_NONE, | ||
| VENTILATION_MODE_AWAY: PRESET_AWAY, | ||
| VENTILATION_MODE_HOME: PRESET_HOME, | ||
| VENTILATION_MODE_HIGH: PRESET_BOOST, | ||
| PRESET_HIGH = "high" | ||
| PRESET_FIREPLACE = "fireplace" | ||
|
Comment on lines
+22
to
+23
|
||
|
|
||
| # Map operation mode (what device reports) to Home Assistant preset | ||
| OPERATION_TO_PRESET_MODE_MAP = { | ||
| OPERATION_MODE_OFF: PRESET_NONE, | ||
| OPERATION_MODE_AWAY: PRESET_AWAY, | ||
| OPERATION_MODE_HOME: PRESET_HOME, | ||
| OPERATION_MODE_HIGH: PRESET_HIGH, | ||
| OPERATION_MODE_FIREPLACE: PRESET_FIREPLACE, | ||
| } | ||
|
|
||
| # Map preset to ventilation mode (for setting standard modes) | ||
| PRESET_TO_VENTILATION_MODE_MAP = { | ||
| PRESET_NONE: VENTILATION_MODE_STOP, | ||
| PRESET_AWAY: VENTILATION_MODE_AWAY, | ||
| PRESET_HOME: VENTILATION_MODE_HOME, | ||
| PRESET_BOOST: VENTILATION_MODE_HIGH, | ||
| PRESET_HIGH: VENTILATION_MODE_HIGH, | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using
PRESET_HOMEas a default fallback could mask issues when an unknown operation mode is encountered. Consider logging a warning when falling back to the default, or usingPRESET_NONEas a more neutral fallback to indicate an unknown state.There was a problem hiding this comment.
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