From ab493eba969b9b72b379303c82ae5303ee1a7c41 Mon Sep 17 00:00:00 2001 From: Karthikeyan Singaravelan Date: Sun, 12 Apr 2020 21:30:57 +0530 Subject: [PATCH] =?UTF-8?q?Import=20ABC=20from=20collections.abc=20instead?= =?UTF-8?q?=20of=20collections=20for=20Pyt=E2=80=A6=20(#34077)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- homeassistant/components/command_line/sensor.py | 4 ++-- homeassistant/components/zha/api.py | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/command_line/sensor.py b/homeassistant/components/command_line/sensor.py index c1fb5f1d21e..f7ae21ab704 100644 --- a/homeassistant/components/command_line/sensor.py +++ b/homeassistant/components/command_line/sensor.py @@ -1,5 +1,5 @@ """Allows to configure custom shell commands to turn a value for a sensor.""" -import collections +from collections.abc import Mapping from datetime import timedelta import json import logging @@ -106,7 +106,7 @@ class CommandSensor(Entity): if value: try: json_dict = json.loads(value) - if isinstance(json_dict, collections.Mapping): + if isinstance(json_dict, Mapping): self._attributes = { k: json_dict[k] for k in self._json_attributes diff --git a/homeassistant/components/zha/api.py b/homeassistant/components/zha/api.py index 433f9dd7ff2..232a5666300 100644 --- a/homeassistant/components/zha/api.py +++ b/homeassistant/components/zha/api.py @@ -2,6 +2,7 @@ import asyncio import collections +from collections.abc import Mapping import logging from typing import Any @@ -677,7 +678,7 @@ async def websocket_unbind_devices(hass, connection, msg): def is_cluster_binding(value: Any) -> ClusterBinding: """Validate and transform a cluster binding.""" - if not isinstance(value, collections.Mapping): + if not isinstance(value, Mapping): raise vol.Invalid("Not a cluster binding") try: cluster_binding = ClusterBinding(