Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: CI

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
tests:
name: "Python ${{ matrix.python-version }}"
runs-on: "ubuntu-latest"

strategy:
matrix:
python-version: ["3.6", "3.7", "3.8"]

steps:
- uses: "actions/checkout@v2"
- uses: "actions/setup-python@v1"
with:
python-version: "${{ matrix.python-version }}"

- name: Install and set up Poetry
run: |
curl -o get-poetry.py https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py
python get-poetry.py -y

- name: "Install tox"
run: |
python -m pip install --upgrade tox tox-gh-actions
- name: "Run tox targets for ${{ matrix.python-version }}"
run: |
source $HOME/.poetry/env
python -m tox
23 changes: 22 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -128,4 +128,25 @@ dmypy.json
# Pyre type checker
.pyre/

.vscode

# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf

# Generated files
.idea/**/contentModel.xml

# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml

# File-based project format
*.iws
25 changes: 25 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

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

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/profiles_settings.xml

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

4 changes: 4 additions & 0 deletions .idea/misc.xml

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

8 changes: 8 additions & 0 deletions .idea/modules.xml

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

14 changes: 14 additions & 0 deletions .idea/python-tahoma-api.iml

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

6 changes: 6 additions & 0 deletions .idea/vcs.xml

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

34 changes: 34 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.5.0
hooks:
- id: check-json
- id: trailing-whitespace
- id: end-of-file-fixer
- repo: https://github.com/python/black
rev: 19.10b0
hooks:
- id: black
language_version: python3.8
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.4.0
hooks:
- id: flake8
language_version: python3.8
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.740
hooks:
- id: mypy
- repo: https://github.com/pre-commit/mirrors-pylint
rev: v2.4.4
hooks:
- id: pylint
- repo: https://github.com/asottile/seed-isort-config
rev: v1.9.4
hooks:
- id: seed-isort-config
- repo: https://github.com/pre-commit/mirrors-isort
rev: v4.3.21
hooks:
- id: isort
additional_dependencies: ['toml']
21 changes: 21 additions & 0 deletions .pylintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[BASIC]
good-names=id

[LOGGING]
logging-format-style=fstr

[MESSAGES CONTROL]
disable=
missing-module-docstring,
missing-class-docstring,
missing-function-docstring,
no-self-use,
too-few-public-methods,
too-many-public-methods,
too-many-arguments,
bad-continuation,
import-error,
unsubscriptable-object,
fixme,
pointless-string-statement,
redefined-builtin
36 changes: 36 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,43 @@
# Somfy TaHoma

<p align=center>
<a href="https://github.com/iMicknl/python-tahoma-api/actions"><img src="https://github.com/iMicknl/python-tahoma-api/workflows/CI/badge.svg"/></a>
<a href="https://github.com/psf/black"><img src="https://img.shields.io/badge/code%20style-black-000000.svg" /></a>
</p>

An updated and async version of the original [tahoma-api](https://github.com/philklei/tahoma-api) by [@philklei](https://github.com/philklei). The aim of this wrapper is to offer an easy to consume Python wrapper for the internal API's used by tahomalink.com.

Somfy TaHoma has an official API, which can be consumed via the [Somfy-open-api](https://github.com/tetienne/somfy-open-api). Unfortunately only a few device classes are supported via the official API, thus the need for this wrapper.

This package is written for the Home Assistant [ha-tahoma](https://github.com/iMicknl/ha-tahoma) integration, but could be used by any Python project interacting with Somfy TaHoma devices.

# Development

## Installation
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dev on VSCode follows this method?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes the installation part is not linked to any IDE. That's the workflow I usualy follow. You should be able to start from scratch in 5 min only.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I use PyCharm any ways, so method 2 is good enough for me!


* For Linux, install [pyenv](https://github.com/pyenv/pyenv) using [pyenv-installer](https://github.com/pyenv/pyenv-installer)
* For MacOS, run `brew install pyenv`
* Don't forget to update your `.bashrc` file (or similar):
```
export PATH="~/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
```
* Install the required [dependencies](https://github.com/pyenv/pyenv/wiki#suggested-build-environment)
* Install [poetry](https://python-poetry.org): `curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python`
* Clone this repository
* `cd python-tahoma-api`
* Install the required Python version: `pyenv install`
* Init the project: `poetry install`
* Run `poetry run pre-commit install`

## PyCharm
As IDE you can use [PyCharm](https://www.jetbrains.com/pycharm/).

Using snap, run `snap install pycharm --classic` to install it.

For MacOS, run `brew cask install pycharm-ce`

Once launched, don't create a new project, but open an existing one and select the **python-tahoma-api** folder.

Go to *File | Settings | Project: nre-tag | Project Interpreter*. Your interpreter must look like `<whatever>/python-tahoma-api/.venv/bin/python`
2 changes: 1 addition & 1 deletion docs/callable_names.txt
Original file line number Diff line number Diff line change
Expand Up @@ -636,4 +636,4 @@ zwave:ZWaveNotificationMotionSensor
zwave:ZWaveNotificationSmokeSensor
zwave:ZWaveNotificationWaterSensor
zwave:ZWaveSmokeSensor
zwave:ZWaveTemperatureSensor
zwave:ZWaveTemperatureSensor
2 changes: 1 addition & 1 deletion docs/jquery-1.10.2-ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -15469,4 +15469,4 @@
}
});

}(jQuery));
}(jQuery));
2 changes: 1 addition & 1 deletion docs/jquery-1.10.2.js
Original file line number Diff line number Diff line change
Expand Up @@ -9884,4 +9884,4 @@
}
}

})(window);
})(window);
Loading