Skip to content

Commit

Permalink
Fix DELTA extra battery name
Browse files Browse the repository at this point in the history
  • Loading branch information
vwt12eh8 committed Aug 12, 2022
1 parent 91afe35 commit ff78f43
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion custom_components/ecoflow/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,11 +319,16 @@ def __init__(self, serial: str, product: int):
@property
def device_info(self):
parent = self.parent.device_info
name = ef.get_model_name(self.product)
if "-" in self.serial:
name += f" {self.parent.serial[-6:]} Extra"
else:
name += f" Extra {self.serial[-6:]}"
return DeviceInfo(
identifiers={(DOMAIN, self.serial)},
manufacturer=parent["manufacturer"],
model=parent["model"] + " Extra Battery",
name=f"{ef.get_model_name(self.product)} Extra {self.serial.split('-')[0][-6:]}",
name=name,
via_device=(DOMAIN, self.parent.serial),
)

Expand Down

0 comments on commit ff78f43

Please sign in to comment.