Skip to content

Commit

Permalink
Rewrite docs for measure script and other cleanups (#1840)
Browse files Browse the repository at this point in the history
* Rewrite docs for measure script and other cleanups

* Revert version change

* Fix mypy issue
  • Loading branch information
bramstroker committed Sep 2, 2023
1 parent db2a3bd commit cae094e
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 63 deletions.
84 changes: 42 additions & 42 deletions poetry.lock

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

23 changes: 23 additions & 0 deletions pyproject.toml
@@ -1,3 +1,26 @@
[project]
name = "Powercalc"
description = "Custom Home Assistant component for virtual power sensors"
maintainers = [
{ name = "Bram Gerritsen", email = "bgerritsen@gmail.com" },
]
keywords = [
"homeassistant",
"energy",
"power",
"custom-component",
"custom-integration",
]
classifiers = [
"Intended Audience :: End Users/Desktop",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.11",
]
requires-python = ">=3.11.0"
dependencies = ["homeassistant"]

[tool.pytest.ini_options]
testpaths = "tests"
norecursedirs = ".git"
Expand Down
26 changes: 6 additions & 20 deletions utils/measure/README.md
Expand Up @@ -37,35 +37,21 @@ To update to the latest version of the script:
Use this installation method when the docker method is not working for you or you want to do any development on the script.

**Prerequisites:**
- Make sure you have Python 3 running on your system. Currently the script is tested with version 3.8, 3.9 and 3.10.
- Make sure you have Python 3 running on your system. Version 3.11 is recommended.
- Install poetry. `curl -sSL https://install.python-poetry.org | python3 -` or see https://python-poetry.org/docs/

Setup requirements for the script.
It is advised to run in a virtual environment.
```
cd utils/measure
python3 -m venv measure
source measure/bin/activate
pip install -r requirements.txt
```

Alternatively use pyenv (https://github.com/pyenv/pyenv)
```
cd utils/measure
pyenv virtualenv 3.10.4 measure
pyenv activate measure
pip install -r requirements.txt
```
Poetry allows you to create virtual environment and manage dependencies.
To install the dependencies:

When this is not working on your machine (i.e. windows) just install globally.
```
cd utils/measure
pip install -r requirements.txt
poetry install
```

#### Start measurements

```
python3 measure.py
poetry run python measure.py
```

The script will ask you a few questions, than proceed taking measurements.
Expand Down
Empty file modified utils/measure/measure.py 100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion utils/measure/pyproject.toml
@@ -1,7 +1,7 @@
[tool.poetry]
name = "measure"
version = "0.1.0"
description = "Powwercalc measurement tool"
description = "Powercalc measurement tool"
authors = ["Bram Gerritsen <bgerritsen@gmail.com>"]
readme = "README.md"

Expand Down

0 comments on commit cae094e

Please sign in to comment.