Skip to content

Commit

Permalink
fix: create ha sensor create by home_assistant_ws
Browse files Browse the repository at this point in the history
  • Loading branch information
m4dm4rtig4n committed Feb 21, 2024
1 parent c38e73c commit 7380db0
Show file tree
Hide file tree
Showing 4 changed files with 129 additions and 66 deletions.
23 changes: 16 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,24 @@ install-asdf:
upgrade-pip:
@$(call poetry, pip install --upgrade pip, "Upgrade pip")

configure-poetry:
configure-poetry:
@$(call title,"Poetry set python version")
@echo "Update python version $(PYTHON_VERSION) in pyproject.toml"
sed -i 's/python = .*/python = "$(PYTHON_VERSION)"/g' pyproject.toml
@echo "Update python version $(PYTHON_VERSION) in Dockerfile"
sed -i 's/FROM python:.*/FROM python:$(PYTHON_VERSION)-slim/g' Dockerfile
@echo "Update python version $(PYTHON_VERSION) in tox.ini"
sed -i 's/min_python_version.*/min_python_version = $(PYTHON_VERSION)/g' tox.ini
sed -i 's/FROM python:.*/FROM python:$(PYTHON_VERSION)-slim/g' Dockerfile
if [ "$(shell uname)" == "Darwin" ]; then \
echo "Update python version $(PYTHON_VERSION) in pyproject.toml"
sed -i '' 's/python = .*/python = "$(PYTHON_VERSION)"/g' pyproject.toml
echo "Update python version $(PYTHON_VERSION) in Dockerfile"
sed -i '' 's/FROM python:.*/FROM python:$(PYTHON_VERSION)-slim/g' Dockerfile
echo "Update python version $(PYTHON_VERSION) in tox.ini"
sed -i '' 's/min_python_version.*/min_python_version = $(PYTHON_VERSION)/g' tox.ini
else\
echo "Update python version $(PYTHON_VERSION) in pyproject.toml"
sed -i 's/python = .*/python = "$(PYTHON_VERSION)"/g' pyproject.toml
echo "Update python version $(PYTHON_VERSION) in Dockerfile"
sed -i 's/FROM python:.*/FROM python:$(PYTHON_VERSION)-slim/g' Dockerfile
echo "Update python version $(PYTHON_VERSION) in tox.ini"
sed -i 's/min_python_version.*/min_python_version = $(PYTHON_VERSION)/g' tox.ini
fi
@$(call title,"Switch venv to $(PYTHON_VERSION)")
poetry env use ~/.asdf/installs/python/$(PYTHON_VERSION)/bin/python
@$(call title,"Poetry self plugin")
Expand Down
106 changes: 53 additions & 53 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def reformat_json(yaml):
return result


def truncate(f, n):
def truncate(f, n=2):
return floor(f * 10**n) / 10**n


Expand Down
Loading

0 comments on commit 7380db0

Please sign in to comment.