diff --git a/custom_components/adaptive_lighting/__init__.py b/custom_components/adaptive_lighting/__init__.py index 99ed5563..f76c52b2 100755 --- a/custom_components/adaptive_lighting/__init__.py +++ b/custom_components/adaptive_lighting/__init__.py @@ -15,10 +15,10 @@ hues. Hormone production, brainwave activity, mood and wakefulness are just some of the cognitive functions tied to cyclical natural light. http://en.wikipedia.org/wiki/Zeitgeber -Here's some further reading: +Further reading: -http://www.cambridgeincolour.com/tutorials/sunrise-sunset-calculator.htm -http://en.wikipedia.org/wiki/Color_temperature +- http://www.cambridgeincolour.com/tutorials/sunrise-sunset-calculator.htm +- http://en.wikipedia.org/wiki/Color_temperature Technical notes: I had to make a lot of assumptions when writing this app * There are no considerations for weather or altitude, but does use your diff --git a/custom_components/adaptive_lighting/const.py b/custom_components/adaptive_lighting/const.py index 3c0def2c..7d649ebb 100644 --- a/custom_components/adaptive_lighting/const.py +++ b/custom_components/adaptive_lighting/const.py @@ -100,7 +100,7 @@ def maybe_coerce(key, validation): return validation -def replace_none(value, replace_with=None): +def replace_none_str(value, replace_with=None): """Replaces "None" -> replace_with.""" return value if value != NONE_STR else replace_with @@ -112,7 +112,7 @@ validation_tuples = [ _DOMAIN_SCHEMA = vol.Schema( { - vol.Optional(key, default=replace_none(default, vol.UNDEFINED)): validation + vol.Optional(key, default=replace_none_str(default, vol.UNDEFINED)): validation for key, default, validation in validation_tuples } ) diff --git a/custom_components/adaptive_lighting/switch.py b/custom_components/adaptive_lighting/switch.py index fad60388..8b3d8ced 100755 --- a/custom_components/adaptive_lighting/switch.py +++ b/custom_components/adaptive_lighting/switch.py @@ -79,7 +79,7 @@ from .const import ( SUN_EVENT_MIDNIGHT, SUN_EVENT_NOON, VALIDATION_TUPLES, - replace_none, + replace_none_str, ) _SUPPORT_OPTS = { @@ -146,7 +146,7 @@ def validate(config_entry): data = deepcopy(defaults) data.update(config_entry.options) # come from options flow data.update(config_entry.data) # all yaml settings come from data - data = {key: replace_none(value) for key, value in data.items()} + data = {key: replace_none_str(value) for key, value in data.items()} for key, (validate, _) in EXTRA_VALIDATION.items(): value = data.get(key) if value is not None: