waterfall config fine-adjustments

* hide the waterfall colors input when pre-defined color scheme is
  selected
* skip unparseable lines on custom color input
* fallback to black and white if custom color config is unusable
* always use the waterfall classes when sending changes to the client
This commit is contained in:
Jakob Ketterl
2021-02-16 18:35:18 +01:00
parent 9aebeb51f8
commit 691d88f841
6 changed files with 30 additions and 8 deletions

View File

@@ -287,7 +287,12 @@ class Ha7ilmWaterfall(Waterfall):
class CustomWaterfall(Waterfall):
def __init__(self):
config = Config.get()
super().__init__(config["waterfall_colors"])
if "waterfall_colors" in config and config["waterfall_colors"]:
colors = config["waterfall_colors"]
else:
# fallback: black and white
colors = [0x000000, 0xffffff]
super().__init__(colors)
class WaterfallOptions(DropdownEnum):