Skip to content

Commit

Permalink
Attribs (#390)
Browse files Browse the repository at this point in the history
* Add attributes to battery_type sensor

* Got some debugging working

* Declare regex as raw string
  • Loading branch information
andrew-codechimp authored Jan 6, 2024
1 parent ebeaa44 commit 5846d19
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion custom_components/battery_notes/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ def extra_state_attributes(self) -> dict[str, str] | None:
"""Return the state attributes of the battery type."""

matches: re.Match = re.search(
"^(\d+)(?=x)(?:x\s)(\w+$)|([\s\S]+)", self._battery_type
r"^(\d+)(?=x)(?:x\s)(\w+$)|([\s\S]+)", self._battery_type
)
if matches:
_qty = matches.group(1) if matches.group(1) is not None else "1"
Expand Down

0 comments on commit 5846d19

Please sign in to comment.