mirror of
https://github.com/home-assistant/core.git
synced 2025-07-10 14:57:09 +00:00
Map silent as a preset mode for fan backcompat (#47396)
The original change did not map silent as a preset mode because it was not clear if it was a speed or a preset.
This commit is contained in:
parent
b58f9ce33a
commit
62d8e47c51
@ -77,6 +77,7 @@ _NOT_SPEED_INTERVAL = "interval"
|
|||||||
_NOT_SPEED_IDLE = "idle"
|
_NOT_SPEED_IDLE = "idle"
|
||||||
_NOT_SPEED_FAVORITE = "favorite"
|
_NOT_SPEED_FAVORITE = "favorite"
|
||||||
_NOT_SPEED_SLEEP = "sleep"
|
_NOT_SPEED_SLEEP = "sleep"
|
||||||
|
_NOT_SPEED_SILENT = "silent"
|
||||||
|
|
||||||
_NOT_SPEEDS_FILTER = {
|
_NOT_SPEEDS_FILTER = {
|
||||||
_NOT_SPEED_OFF,
|
_NOT_SPEED_OFF,
|
||||||
@ -85,6 +86,7 @@ _NOT_SPEEDS_FILTER = {
|
|||||||
_NOT_SPEED_SMART,
|
_NOT_SPEED_SMART,
|
||||||
_NOT_SPEED_INTERVAL,
|
_NOT_SPEED_INTERVAL,
|
||||||
_NOT_SPEED_IDLE,
|
_NOT_SPEED_IDLE,
|
||||||
|
_NOT_SPEED_SILENT,
|
||||||
_NOT_SPEED_SLEEP,
|
_NOT_SPEED_SLEEP,
|
||||||
_NOT_SPEED_FAVORITE,
|
_NOT_SPEED_FAVORITE,
|
||||||
}
|
}
|
||||||
@ -651,7 +653,7 @@ def speed_list_without_preset_modes(speed_list: List):
|
|||||||
output: ["1", "2", "3", "4", "5", "6", "7"]
|
output: ["1", "2", "3", "4", "5", "6", "7"]
|
||||||
|
|
||||||
input: ["Auto", "Silent", "Favorite", "Idle", "Medium", "High", "Strong"]
|
input: ["Auto", "Silent", "Favorite", "Idle", "Medium", "High", "Strong"]
|
||||||
output: ["Silent", "Medium", "High", "Strong"]
|
output: ["Medium", "High", "Strong"]
|
||||||
"""
|
"""
|
||||||
|
|
||||||
return [speed for speed in speed_list if speed.lower() not in _NOT_SPEEDS_FILTER]
|
return [speed for speed in speed_list if speed.lower() not in _NOT_SPEEDS_FILTER]
|
||||||
@ -673,7 +675,7 @@ def preset_modes_from_speed_list(speed_list: List):
|
|||||||
output: ["smart"]
|
output: ["smart"]
|
||||||
|
|
||||||
input: ["Auto", "Silent", "Favorite", "Idle", "Medium", "High", "Strong"]
|
input: ["Auto", "Silent", "Favorite", "Idle", "Medium", "High", "Strong"]
|
||||||
output: ["Auto", "Favorite", "Idle"]
|
output: ["Auto", "Silent", "Favorite", "Idle"]
|
||||||
"""
|
"""
|
||||||
|
|
||||||
return [
|
return [
|
||||||
|
Loading…
x
Reference in New Issue
Block a user