From 62d8e47c5184927f7eebe919cab524b2b68a1f42 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Thu, 4 Mar 2021 11:02:50 -1000 Subject: [PATCH] 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. --- homeassistant/components/fan/__init__.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/fan/__init__.py b/homeassistant/components/fan/__init__.py index 25911eb2d06..7a50997d76d 100644 --- a/homeassistant/components/fan/__init__.py +++ b/homeassistant/components/fan/__init__.py @@ -77,6 +77,7 @@ _NOT_SPEED_INTERVAL = "interval" _NOT_SPEED_IDLE = "idle" _NOT_SPEED_FAVORITE = "favorite" _NOT_SPEED_SLEEP = "sleep" +_NOT_SPEED_SILENT = "silent" _NOT_SPEEDS_FILTER = { _NOT_SPEED_OFF, @@ -85,6 +86,7 @@ _NOT_SPEEDS_FILTER = { _NOT_SPEED_SMART, _NOT_SPEED_INTERVAL, _NOT_SPEED_IDLE, + _NOT_SPEED_SILENT, _NOT_SPEED_SLEEP, _NOT_SPEED_FAVORITE, } @@ -651,7 +653,7 @@ def speed_list_without_preset_modes(speed_list: List): output: ["1", "2", "3", "4", "5", "6", "7"] 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] @@ -673,7 +675,7 @@ def preset_modes_from_speed_list(speed_list: List): output: ["smart"] input: ["Auto", "Silent", "Favorite", "Idle", "Medium", "High", "Strong"] - output: ["Auto", "Favorite", "Idle"] + output: ["Auto", "Silent", "Favorite", "Idle"] """ return [