Fix implicit-return in dublin bus transport (#122833)

This commit is contained in:
epenet 2024-07-30 15:33:05 +02:00 committed by GitHub
parent ea508b2629
commit 2135691b90
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -9,6 +9,7 @@ from __future__ import annotations
from contextlib import suppress from contextlib import suppress
from datetime import datetime, timedelta from datetime import datetime, timedelta
from http import HTTPStatus from http import HTTPStatus
from typing import Any
import requests import requests
import voluptuous as vol import voluptuous as vol
@ -102,7 +103,7 @@ class DublinPublicTransportSensor(SensorEntity):
return self._state return self._state
@property @property
def extra_state_attributes(self): def extra_state_attributes(self) -> dict[str, Any] | None:
"""Return the state attributes.""" """Return the state attributes."""
if self._times is not None: if self._times is not None:
next_up = "None" next_up = "None"
@ -117,6 +118,7 @@ class DublinPublicTransportSensor(SensorEntity):
ATTR_ROUTE: self._times[0][ATTR_ROUTE], ATTR_ROUTE: self._times[0][ATTR_ROUTE],
ATTR_NEXT_UP: next_up, ATTR_NEXT_UP: next_up,
} }
return None
@property @property
def native_unit_of_measurement(self): def native_unit_of_measurement(self):