Use const instead of literal string in HVV integration (#118479)

Use const instead of literal string
This commit is contained in:
Tsvi Mostovicz 2024-05-30 14:59:38 +03:00 committed by GitHub
parent c387698c6f
commit e3f6d4cfbf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -9,7 +9,7 @@ from pygti.exceptions import InvalidAuth
from homeassistant.components.sensor import SensorDeviceClass, SensorEntity
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import ATTR_ID
from homeassistant.const import ATTR_ID, CONF_OFFSET
from homeassistant.core import HomeAssistant
from homeassistant.helpers import aiohttp_client
from homeassistant.helpers.device_registry import DeviceEntryType, DeviceInfo
@ -92,7 +92,7 @@ class HVVDepartureSensor(SensorEntity):
async def async_update(self, **kwargs: Any) -> None:
"""Update the sensor."""
departure_time = utcnow() + timedelta(
minutes=self.config_entry.options.get("offset", 0)
minutes=self.config_entry.options.get(CONF_OFFSET, 0)
)
departure_time_tz_berlin = departure_time.astimezone(BERLIN_TIME_ZONE)