Skip to content

Commit

Permalink
Use constants for device_info in Renault integration (#53714)
Browse files Browse the repository at this point in the history
* Use constants for device_info

* Fix isort
  • Loading branch information
epenet authored Jul 30, 2021
1 parent bb7236f commit b3f0d68
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions homeassistant/components/renault/renault_vehicle.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@
from renault_api.kamereon import models
from renault_api.renault_vehicle import RenaultVehicle

from homeassistant.const import (
ATTR_IDENTIFIERS,
ATTR_MANUFACTURER,
ATTR_MODEL,
ATTR_NAME,
ATTR_SW_VERSION,
)
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity import DeviceInfo

Expand All @@ -33,11 +40,11 @@ def __init__(
self._vehicle = vehicle
self._details = details
self._device_info: DeviceInfo = {
"identifiers": {(DOMAIN, cast(str, details.vin))},
"manufacturer": (details.get_brand_label() or "").capitalize(),
"model": (details.get_model_label() or "").capitalize(),
"name": details.registrationNumber or "",
"sw_version": details.get_model_code() or "",
ATTR_IDENTIFIERS: {(DOMAIN, cast(str, details.vin))},
ATTR_MANUFACTURER: (details.get_brand_label() or "").capitalize(),
ATTR_MODEL: (details.get_model_label() or "").capitalize(),
ATTR_NAME: details.registrationNumber or "",
ATTR_SW_VERSION: details.get_model_code() or "",
}
self.coordinators: dict[str, RenaultDataUpdateCoordinator] = {}
self.hvac_target_temperature = 21
Expand Down

0 comments on commit b3f0d68

Please sign in to comment.