Skip to content

Commit f715e8a

Browse files
Q-ClawAndrei Ignat
andauthored
Remove hardcoded battery icon for Battery State of Charge (#306)
* Remove hardcoded icon for battery SOC sensor Allow Home Assistant to apply dynamic battery icon based on state of charge. * Remove hardcoded battery icons for other SOC sensors Keep SOC sensors consistent and allow Home Assistant dynamic battery icons. --------- Co-authored-by: Andrei Ignat <andrei@example.com>
1 parent 968d21d commit f715e8a

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

custom_components/sigen/static_sensor.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,8 @@ class StaticSensors:
9797
device_class=SensorDeviceClass.BATTERY,
9898
native_unit_of_measurement=PERCENTAGE,
9999
state_class=SensorStateClass.MEASUREMENT,
100-
icon="mdi:battery",
100+
# Intentionally no hardcoded icon: allow Home Assistant to use
101+
# the default dynamic battery icon based on SOC.
101102
),
102103
SigenergySensorEntityDescription(
103104
key="plant_phase_a_active_power",
@@ -1299,7 +1300,8 @@ class StaticSensors:
12991300
device_class=SensorDeviceClass.BATTERY,
13001301
native_unit_of_measurement=PERCENTAGE,
13011302
state_class=SensorStateClass.MEASUREMENT,
1302-
icon="mdi:battery",
1303+
# Intentionally no hardcoded icon: allow Home Assistant to use
1304+
# the default dynamic battery icon based on SOC.
13031305
),
13041306
SigenergySensorEntityDescription(
13051307
key="inverter_ess_battery_soh",
@@ -1769,7 +1771,8 @@ class StaticSensors:
17691771
device_class=SensorDeviceClass.BATTERY,
17701772
native_unit_of_measurement=PERCENTAGE,
17711773
state_class=SensorStateClass.MEASUREMENT,
1772-
icon="mdi:battery",
1774+
# Intentionally no hardcoded icon: allow Home Assistant to use
1775+
# the default dynamic battery icon based on SOC.
17731776
),
17741777
SigenergySensorEntityDescription(
17751778
key="dc_charger_current_charging_capacity",

0 commit comments

Comments
 (0)