From 7c5090d627eb21e07db88f6126a156405ab3f0b2 Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Mon, 19 May 2025 14:55:48 +0200 Subject: [PATCH] Add missing type hint in zestimate (#145218) --- homeassistant/components/zestimate/sensor.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/zestimate/sensor.py b/homeassistant/components/zestimate/sensor.py index ec8850b187d..6b3b38bdde8 100644 --- a/homeassistant/components/zestimate/sensor.py +++ b/homeassistant/components/zestimate/sensor.py @@ -107,13 +107,13 @@ class ZestimateDataSensor(SensorEntity): attributes["address"] = self.address return attributes - def update(self): + def update(self) -> None: """Get the latest data and update the states.""" try: response = requests.get(_RESOURCE, params=self.params, timeout=5) data = response.content.decode("utf-8") - data_dict = xmltodict.parse(data).get(ZESTIMATE) + data_dict = xmltodict.parse(data)[ZESTIMATE] error_code = int(data_dict["message"]["code"]) if error_code != 0: _LOGGER.error("The API returned: %s", data_dict["message"]["text"])