Skip to content

Commit

Permalink
Merge pull request #633 from WillCodeForCats/remove-units-from-names
Browse files Browse the repository at this point in the history
Remove units from default entity names
  • Loading branch information
WillCodeForCats authored Aug 23, 2024
2 parents c50172d + 8ede1fa commit a676f31
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions custom_components/solaredge_modbus_multi/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -662,9 +662,9 @@ def unique_id(self) -> str:
@property
def name(self) -> str:
if self._phase is None:
return "AC VA"
return "AC Apparent Power"
else:
return f"AC VA {self._phase.upper()}"
return f"AC Apparent Power {self._phase.upper()}"

@property
def entity_registry_enabled_default(self) -> bool:
Expand Down Expand Up @@ -719,9 +719,9 @@ def unique_id(self) -> str:
@property
def name(self) -> str:
if self._phase is None:
return "AC var"
return "AC Reactive Power"
else:
return f"AC var {self._phase.upper()}"
return f"AC Reactive Power {self._phase.upper()}"

@property
def entity_registry_enabled_default(self) -> bool:
Expand Down Expand Up @@ -776,9 +776,9 @@ def unique_id(self) -> str:
@property
def name(self) -> str:
if self._phase is None:
return "AC PF"
return "AC Power Factor"
else:
return f"AC PF {self._phase.upper()}"
return f"AC Power Factor {self._phase.upper()}"

@property
def entity_registry_enabled_default(self) -> bool:
Expand Down Expand Up @@ -887,7 +887,7 @@ def name(self) -> str:
if self._phase is None:
return "AC Energy"
else:
return f"{re.sub('_', ' ', self._phase)}"
return f"AC Energy {re.sub('_', ' ', self._phase)}"

@property
def available(self) -> bool:
Expand Down Expand Up @@ -1652,7 +1652,7 @@ def name(self) -> str:
if self._phase is None:
raise NotImplementedError
else:
return f"{re.sub('_', ' ', self._phase)} VAh"
return f"Apparent Energy {re.sub('_', ' ', self._phase)}"

@property
def native_value(self):
Expand Down Expand Up @@ -1730,7 +1730,7 @@ def name(self) -> str:
if self._phase is None:
raise NotImplementedError
else:
return f"{re.sub('_', ' ', self._phase)} varh"
return f"Reactive Energy {re.sub('_', ' ', self._phase)}"

@property
def native_value(self):
Expand Down

0 comments on commit a676f31

Please sign in to comment.