From 9afb1d8c0dbacf3f36e3ea6d6513bcd7e13be242 Mon Sep 17 00:00:00 2001 From: Martin Hjelmare Date: Tue, 16 Aug 2016 07:12:43 +0200 Subject: [PATCH] Fix unit log message (#2823) * Fix log message for deprecated temp key * Use string formatting and pass constant variables as arguments in log message to show correct name of config keys. * Fix import order --- homeassistant/config.py | 5 +++-- homeassistant/util/yaml.py | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/homeassistant/config.py b/homeassistant/config.py index 65ed44bef83..d67bbea0bc6 100644 --- a/homeassistant/config.py +++ b/homeassistant/config.py @@ -267,8 +267,9 @@ def process_ha_core_config(hass, config): else: hac.units = IMPERIAL_SYSTEM _LOGGER.warning("Found deprecated temperature unit in core config, " - "expected unit system. Replace 'temperature: %s' with " - "'unit_system: %s'", unit, hac.units.name) + "expected unit system. Replace '%s: %s' with " + "'%s: %s'", CONF_TEMPERATURE_UNIT, unit, + CONF_UNIT_SYSTEM, hac.units.name) # Shortcut if no auto-detection necessary if None not in (hac.latitude, hac.longitude, hac.units, diff --git a/homeassistant/util/yaml.py b/homeassistant/util/yaml.py index 8b2521e3e9b..c88daaab69a 100644 --- a/homeassistant/util/yaml.py +++ b/homeassistant/util/yaml.py @@ -1,10 +1,10 @@ """YAML utility functions.""" +import glob import logging import os from collections import OrderedDict from typing import Union, List, Dict -import glob import yaml try: import keyring