From 4a6f1f150a837e654c7b6af8f26dec64c6bd5dc1 Mon Sep 17 00:00:00 2001 From: Alex <33379584+alexyao2015@users.noreply.github.com> Date: Sun, 5 Sep 2021 21:48:28 -0500 Subject: [PATCH] Fix runtime exception due to dict typing (#2243) --- esphome/zeroconf.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/esphome/zeroconf.py b/esphome/zeroconf.py index bc3f905261..e94b59d3ae 100644 --- a/esphome/zeroconf.py +++ b/esphome/zeroconf.py @@ -1,7 +1,7 @@ import socket import threading import time -from typing import Optional +from typing import Dict, Optional from zeroconf import ( _CLASS_IN, @@ -64,7 +64,7 @@ class DashboardStatus(RecordUpdateListener, threading.Thread): threading.Thread.__init__(self) self.zc = zc self.query_hosts: set[str] = set() - self.key_to_host: dict[str, str] = {} + self.key_to_host: Dict[str, str] = {} self.stop_event = threading.Event() self.query_event = threading.Event() self.on_update = on_update @@ -72,7 +72,7 @@ class DashboardStatus(RecordUpdateListener, threading.Thread): def update_record(self, zc: Zeroconf, now: float, record: DNSRecord) -> None: pass - def request_query(self, hosts: dict[str, str]) -> None: + def request_query(self, hosts: Dict[str, str]) -> None: self.query_hosts = set(hosts.values()) self.key_to_host = hosts self.query_event.set()