diff --git a/homeassistant/components/alpha_vantage/sensor.py b/homeassistant/components/alpha_vantage/sensor.py index 534383f0bbf..02c6958e0da 100644 --- a/homeassistant/components/alpha_vantage/sensor.py +++ b/homeassistant/components/alpha_vantage/sensor.py @@ -128,7 +128,7 @@ class AlphaVantageSensor(SensorEntity): self._attr_native_unit_of_measurement = symbol.get(CONF_CURRENCY, self._symbol) self._attr_icon = ICONS.get(symbol.get(CONF_CURRENCY, "USD")) - def update(self): + def update(self) -> None: """Get the latest data and updates the states.""" _LOGGER.debug("Requesting new data for symbol %s", self._symbol) all_values, _ = self._timeseries.get_intraday(self._symbol) @@ -144,7 +144,7 @@ class AlphaVantageSensor(SensorEntity): ATTR_LOW: values["3. low"], } if isinstance(values, dict) - else None + else {} ) _LOGGER.debug("Received new values for symbol %s", self._symbol) @@ -167,7 +167,7 @@ class AlphaVantageForeignExchange(SensorEntity): self._attr_icon = ICONS.get(self._from_currency, "USD") self._attr_native_unit_of_measurement = self._to_currency - def update(self): + def update(self) -> None: """Get the latest data and updates the states.""" _LOGGER.debug( "Requesting new data for forex %s - %s", @@ -187,7 +187,7 @@ class AlphaVantageForeignExchange(SensorEntity): CONF_TO: self._to_currency, } if values is not None - else None + else {} ) _LOGGER.debug(