initial commit
This commit is contained in:
24
custom_components/kia_uvo/entity.py
Normal file
24
custom_components/kia_uvo/entity.py
Normal file
@@ -0,0 +1,24 @@
|
||||
"""Base Entity for Hyundai / Kia Connect integration."""
|
||||
from homeassistant.helpers.update_coordinator import CoordinatorEntity
|
||||
from homeassistant.helpers.entity import DeviceInfo
|
||||
|
||||
from .const import BRANDS, DOMAIN, REGIONS
|
||||
|
||||
|
||||
class HyundaiKiaConnectEntity(CoordinatorEntity):
|
||||
"""Class for base entity for Hyundai / Kia Connect integration."""
|
||||
|
||||
def __init__(self, coordinator, vehicle):
|
||||
"""Initialize the base entity."""
|
||||
super().__init__(coordinator)
|
||||
self.vehicle = vehicle
|
||||
|
||||
@property
|
||||
def device_info(self):
|
||||
"""Return device information to use for this entity."""
|
||||
return DeviceInfo(
|
||||
identifiers={(DOMAIN, self.vehicle.id)},
|
||||
manufacturer=f"{BRANDS[self.coordinator.vehicle_manager.brand]} {REGIONS[self.coordinator.vehicle_manager.region]}",
|
||||
model=self.vehicle.model,
|
||||
name=self.vehicle.name,
|
||||
)
|
||||
Reference in New Issue
Block a user