Skip to content
This repository has been archived by the owner on Dec 3, 2024. It is now read-only.

Commit

Permalink
Add workaround for strange degree unit
Browse files Browse the repository at this point in the history
  • Loading branch information
elupus committed May 6, 2023
1 parent f930d77 commit 53a06ac
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 2 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
repos:
- repo: https://github.com/psf/black
rev: 22.12.0
rev: 23.3.0
hooks:
- id: black
args:
- --safe
- --quiet
- repo: https://github.com/PyCQA/isort
rev: 5.11.4
rev: 5.12.0
hooks:
- id: isort
- repo: https://github.com/asottile/pyupgrade
Expand Down
3 changes: 3 additions & 0 deletions entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ def get_unit(
if data is None or not data["unit"]:
return default
else:
# Work around strange degree unit
if data["unit"] == "ºC":
return "°C"
return data["unit"]

def get_raw(self, parameter_id: ParameterId | None, default=None):
Expand Down

0 comments on commit 53a06ac

Please sign in to comment.