Fix WUnderground duplicate entity ids (#13285)

* Fix WUnderground duplicate entity ids

* Entity Namespace
This commit is contained in:
Otto Winter authored and GitHub committed 2018-03-17 13:14:53 +01:00
1 parent f5093b474a
commit 3442b6741d
4 files changed
+45 -8

No files matched your search

+2 -2
View File
@@ -13,7 +13,7 @@ from functools import wraps
from types import MappingProxyType
from unicodedata import normalize
from typing import Any, Optional, TypeVar, Callable, Sequence, KeysView, Union
from typing import Any, Optional, TypeVar, Callable, KeysView, Union, Iterable
from .dt import as_local, utcnow
@@ -72,7 +72,7 @@ def convert(value: T, to_type: Callable[[T], U],
def ensure_unique_string(preferred_string: str, current_strings:
Union[Sequence[str], KeysView[str]]) -> str:
Union[Iterable[str], KeysView[str]]) -> str:
"""Return a string that is not present in current_strings.
If preferred string exists will append _2, _3, ..