Skip to content

Commit

Permalink
Revert "Add _attr_has_entity_name to all sensors"
Browse files Browse the repository at this point in the history
This reverts commit d8e17e4.
  • Loading branch information
dan-r committed Apr 13, 2024
1 parent d8e17e4 commit cfaa363
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 24 deletions.
5 changes: 0 additions & 5 deletions custom_components/ohme/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ class ConnectedBinarySensor(

_attr_name = "Car Connected"
_attr_device_class = BinarySensorDeviceClass.PLUG
_attr_has_entity_name = True

def __init__(
self,
Expand Down Expand Up @@ -88,7 +87,6 @@ class ChargingBinarySensor(

_attr_name = "Car Charging"
_attr_device_class = BinarySensorDeviceClass.BATTERY_CHARGING
_attr_has_entity_name = True

def __init__(
self,
Expand Down Expand Up @@ -217,7 +215,6 @@ class PendingApprovalBinarySensor(
"""Binary sensor for if a charge is pending approval."""

_attr_name = "Pending Approval"
_attr_has_entity_name = True

def __init__(
self,
Expand Down Expand Up @@ -264,7 +261,6 @@ class CurrentSlotBinarySensor(
"""Binary sensor for if we are currently in a smart charge slot."""

_attr_name = "Charge Slot Active"
_attr_has_entity_name = True

def __init__(
self,
Expand Down Expand Up @@ -331,7 +327,6 @@ class ChargerOnlineBinarySensor(

_attr_name = "Charger Online"
_attr_device_class = BinarySensorDeviceClass.CONNECTIVITY
_attr_has_entity_name = True

def __init__(
self,
Expand Down
1 change: 0 additions & 1 deletion custom_components/ohme/button.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ async def async_setup_entry(
class OhmeApproveChargeButton(ButtonEntity):
"""Button for approving a charge."""
_attr_name = "Approve Charge"
_attr_has_entity_name = True

def __init__(self, coordinator: OhmeChargeSessionsCoordinator, hass: HomeAssistant, client):
self._client = client
Expand Down
3 changes: 0 additions & 3 deletions custom_components/ohme/number.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ class TargetPercentNumber(NumberEntity):
_attr_device_class = NumberDeviceClass.BATTERY
_attr_native_unit_of_measurement = PERCENTAGE
_attr_suggested_display_precision = 0
_attr_has_entity_name = True

def __init__(self, coordinator, coordinator_schedules, hass: HomeAssistant, client):
self.coordinator = coordinator
Expand Down Expand Up @@ -112,7 +111,6 @@ class PreconditioningNumber(NumberEntity):
_attr_native_min_value = 0
_attr_native_step = 5
_attr_native_max_value = 60
_attr_has_entity_name = True

def __init__(self, coordinator, coordinator_schedules, hass: HomeAssistant, client):
self.coordinator = coordinator
Expand Down Expand Up @@ -201,7 +199,6 @@ class PriceCapNumber(NumberEntity):
_attr_native_step = 0.1
_attr_native_min_value = -100
_attr_native_max_value = 100
_attr_has_entity_name = True

def __init__(self, coordinator, hass: HomeAssistant, client):
self.coordinator = coordinator
Expand Down
10 changes: 0 additions & 10 deletions custom_components/ohme/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ class PowerDrawSensor(CoordinatorEntity[OhmeChargeSessionsCoordinator], SensorEn
_attr_name = "Power Draw"
_attr_native_unit_of_measurement = UnitOfPower.WATT
_attr_device_class = SensorDeviceClass.POWER
_attr_has_entity_name = True

def __init__(
self,
Expand Down Expand Up @@ -97,7 +96,6 @@ class CurrentDrawSensor(CoordinatorEntity[OhmeChargeSessionsCoordinator], Sensor
_attr_name = "Current Draw"
_attr_device_class = SensorDeviceClass.CURRENT
_attr_native_unit_of_measurement = UnitOfElectricCurrent.AMPERE
_attr_has_entity_name = True

def __init__(
self,
Expand Down Expand Up @@ -140,7 +138,6 @@ class VoltageSensor(CoordinatorEntity[OhmeChargeSessionsCoordinator], SensorEnti
_attr_name = "Voltage"
_attr_device_class = SensorDeviceClass.VOLTAGE
_attr_native_unit_of_measurement = UnitOfElectricPotential.VOLT
_attr_has_entity_name = True

def __init__(
self,
Expand Down Expand Up @@ -183,7 +180,6 @@ class CTSensor(CoordinatorEntity[OhmeAdvancedSettingsCoordinator], SensorEntity)
_attr_name = "CT Reading"
_attr_device_class = SensorDeviceClass.CURRENT
_attr_native_unit_of_measurement = UnitOfElectricCurrent.AMPERE
_attr_has_entity_name = True

def __init__(
self,
Expand Down Expand Up @@ -227,7 +223,6 @@ class AccumulativeEnergyUsageSensor(CoordinatorEntity[OhmeStatisticsCoordinator]
_attr_suggested_display_precision = 1
_attr_device_class = SensorDeviceClass.ENERGY
_attr_state_class = SensorStateClass.TOTAL
_attr_has_entity_name = True

def __init__(
self,
Expand Down Expand Up @@ -274,7 +269,6 @@ class EnergyUsageSensor(CoordinatorEntity[OhmeChargeSessionsCoordinator], Sensor
_attr_suggested_display_precision = 1
_attr_device_class = SensorDeviceClass.ENERGY
_attr_state_class = SensorStateClass.TOTAL_INCREASING
_attr_has_entity_name = True

def __init__(
self,
Expand Down Expand Up @@ -326,7 +320,6 @@ class NextSlotStartSensor(CoordinatorEntity[OhmeChargeSessionsCoordinator], Sens
"""Sensor for next smart charge slot start time."""
_attr_name = "Next Charge Slot Start"
_attr_device_class = SensorDeviceClass.TIMESTAMP
_attr_has_entity_name = True

def __init__(
self,
Expand Down Expand Up @@ -379,7 +372,6 @@ class NextSlotEndSensor(CoordinatorEntity[OhmeChargeSessionsCoordinator], Sensor
"""Sensor for next smart charge slot end time."""
_attr_name = "Next Charge Slot End"
_attr_device_class = SensorDeviceClass.TIMESTAMP
_attr_has_entity_name = True

def __init__(
self,
Expand Down Expand Up @@ -431,7 +423,6 @@ def _handle_coordinator_update(self) -> None:
class SlotListSensor(CoordinatorEntity[OhmeChargeSessionsCoordinator], SensorEntity):
"""Sensor for next smart charge slot end time."""
_attr_name = "Charge Slots"
_attr_has_entity_name = True

def __init__(
self,
Expand Down Expand Up @@ -496,7 +487,6 @@ class BatterySOCSensor(CoordinatorEntity[OhmeChargeSessionsCoordinator], SensorE
_attr_native_unit_of_measurement = PERCENTAGE
_attr_device_class = SensorDeviceClass.BATTERY
_attr_suggested_display_precision = 0
_attr_has_entity_name = True

def __init__(
self,
Expand Down
4 changes: 0 additions & 4 deletions custom_components/ohme/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ async def async_setup_entry(
class OhmePauseChargeSwitch(CoordinatorEntity[OhmeChargeSessionsCoordinator], SwitchEntity):
"""Switch for pausing a charge."""
_attr_name = "Pause Charge"
_attr_has_entity_name = True

def __init__(self, coordinator, hass: HomeAssistant, client):
super().__init__(coordinator=coordinator)
Expand Down Expand Up @@ -113,7 +112,6 @@ async def async_turn_off(self):
class OhmeMaxChargeSwitch(CoordinatorEntity[OhmeChargeSessionsCoordinator], SwitchEntity):
"""Switch for pausing a charge."""
_attr_name = "Max Charge"
_attr_has_entity_name = True

def __init__(self, coordinator, hass: HomeAssistant, client):
super().__init__(coordinator=coordinator)
Expand Down Expand Up @@ -172,7 +170,6 @@ async def async_turn_off(self):

class OhmeConfigurationSwitch(CoordinatorEntity[OhmeAccountInfoCoordinator], SwitchEntity):
"""Switch for changing configuration options."""
_attr_has_entity_name = True

def __init__(self, coordinator, hass: HomeAssistant, client, name, icon, config_key):
super().__init__(coordinator=coordinator)
Expand Down Expand Up @@ -232,7 +229,6 @@ async def async_turn_off(self):
class OhmePriceCapSwitch(CoordinatorEntity[OhmeAccountInfoCoordinator], SwitchEntity):
"""Switch for enabling price cap."""
_attr_name = "Enable Price Cap"
_attr_has_entity_name = True

def __init__(self, coordinator, hass: HomeAssistant, client):
super().__init__(coordinator=coordinator)
Expand Down
1 change: 0 additions & 1 deletion custom_components/ohme/time.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ async def async_setup_entry(
class TargetTime(TimeEntity):
"""Target time sensor."""
_attr_name = "Target Time"
_attr_has_entity_name = True

def __init__(self, coordinator, coordinator_schedules, hass: HomeAssistant, client):
self.coordinator = coordinator
Expand Down

0 comments on commit cfaa363

Please sign in to comment.