Skip to content

Commit ca42f0d

Browse files
Use proper multiplication sign instead of letter x (#1005)
* Use proper multiplication sign instead of letter x * Change to multiplier in library and correct discovery --------- Co-authored-by: Andrew Jackson <[email protected]>
1 parent f05807f commit ca42f0d

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

custom_components/battery_notes/coordinator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ def current_battery_level(self, value):
144144
def battery_type_and_quantity(self) -> str:
145145
"""Merge battery type & quantity."""
146146
if self.battery_quantity and int(self.battery_quantity) > 1:
147-
return str(self.battery_quantity) + "x " + self.battery_type
147+
return str(self.battery_quantity) + "× " + self.battery_type
148148
return self.battery_type
149149

150150
@property

custom_components/battery_notes/discovery.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
CONF_MANUFACTURER,
1717
CONF_MODEL,
1818
CONF_BATTERY_TYPE,
19+
CONF_BATTERY_QUANTITY,
1920
DOMAIN,
2021
)
2122
from .library import ModelInfo, DeviceBatteryDetails, Library
@@ -145,7 +146,10 @@ def _init_entity_discovery(
145146
if device_battery_details:
146147
discovery_data[
147148
CONF_BATTERY_TYPE
148-
] = device_battery_details.battery_type_and_quantity
149+
] = device_battery_details.battery_type
150+
discovery_data[
151+
CONF_BATTERY_QUANTITY
152+
] = device_battery_details.battery_quantity
149153
discovery_data[CONF_MANUFACTURER] = device_battery_details.manufacturer
150154
discovery_data[CONF_MODEL] = device_battery_details.model
151155
discovery_data[CONF_DEVICE_NAME] = get_wrapped_device_name(

custom_components/battery_notes/library.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ def battery_type_and_quantity(self):
140140
quantity = 0
141141

142142
if quantity > 1:
143-
batteries = str(quantity) + "x " + self.battery_type
143+
batteries = str(quantity) + "× " + self.battery_type
144144
else:
145145
batteries = self.battery_type
146146

0 commit comments

Comments
 (0)