Import ABC from collections.abc instead of collections for Pyt… (#34077)

This commit is contained in:
Karthikeyan Singaravelan 2020-04-12 21:30:57 +05:30 committed by GitHub
parent c25cf82668
commit ab493eba96
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View file

@ -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