Skip to content

Commit

Permalink
Drop unused unit_system from bmw (home-assistant#80176)
Browse files Browse the repository at this point in the history
  • Loading branch information
epenet authored Oct 12, 2022
1 parent 1c86a12 commit 54587e9
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions homeassistant/components/bmw_connected_drive/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.typing import StateType
from homeassistant.util.unit_system import UnitSystem

from . import BMWBaseEntity
from .const import DOMAIN, UNIT_MAP
Expand Down Expand Up @@ -137,15 +136,14 @@ async def async_setup_entry(
async_add_entities: AddEntitiesCallback,
) -> None:
"""Set up the MyBMW sensors from config entry."""
unit_system = hass.config.units
coordinator: BMWDataUpdateCoordinator = hass.data[DOMAIN][config_entry.entry_id]

entities: list[BMWSensor] = []

for vehicle in coordinator.account.vehicles:
entities.extend(
[
BMWSensor(coordinator, vehicle, description, unit_system)
BMWSensor(coordinator, vehicle, description)
for attribute_name in vehicle.available_attributes
if (description := SENSOR_TYPES.get(attribute_name))
]
Expand All @@ -164,7 +162,6 @@ def __init__(
coordinator: BMWDataUpdateCoordinator,
vehicle: MyBMWVehicle,
description: BMWSensorEntityDescription,
unit_system: UnitSystem,
) -> None:
"""Initialize BMW vehicle sensor."""
super().__init__(coordinator, vehicle)
Expand Down

0 comments on commit 54587e9

Please sign in to comment.