-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from Leggin/support-for-older-python-versions
Support for older python versions
- Loading branch information
Showing
8 changed files
with
65 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ build-backend = "setuptools.build_meta" | |
|
||
[project] | ||
name = "dirigera" | ||
version = "0.1.3" | ||
version = "0.1.4" | ||
description = "An unofficial Python client for controlling the IKEA Dirigera Smart Home Hub" | ||
readme = "README.md" | ||
authors = [{ name = "Leggin", email = "[email protected]" }] | ||
|
@@ -17,9 +17,14 @@ dependencies = [ | |
"requests >= 2.22.0", | ||
"websocket-client >= 1.0.0", | ||
] | ||
requires-python = ">=3.10" | ||
requires-python = ">=3.7" | ||
classifiers = [ | ||
"Programming Language :: Python :: 3", | ||
"Programming Language :: Python :: 3.7", | ||
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
"Programming Language :: Python :: 3.12", | ||
"License :: OSI Approved :: MIT License", | ||
"Operating System :: OS Independent", | ||
] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
declare -a arr=("3.7" "3.8" "3.9" "3.10" "3.11" "3.12") | ||
set -e | ||
set -o pipefail | ||
for i in "${arr[@]}" | ||
do | ||
echo "$i" | ||
docker run -v ~/src/dirigera:/dirigera python:"$i"-slim /bin/bash -c " | ||
cd /dirigera | ||
pip install -r requirements.txt > /dev/null | ||
pip install -r dev-requirements.txt > /dev/null | ||
bash run-test.sh" | ||
|
||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,24 @@ | ||
import abc | ||
from typing import Any | ||
from typing import Any, Dict, List | ||
|
||
|
||
class AbstractSmartHomeHub(abc.ABC): | ||
@abc.abstractmethod | ||
def patch(self, route: str, data: dict[str, Any]) -> dict[str, Any]: | ||
def patch(self, route: str, data: Dict[str, Any]) -> Dict[str, Any]: | ||
raise NotImplementedError | ||
|
||
@abc.abstractmethod | ||
def get(self, route: str) -> dict[str, Any]: | ||
def get(self, route: str) -> Dict[str, Any]: | ||
raise NotImplementedError | ||
|
||
|
||
class FakeDirigeraHub(AbstractSmartHomeHub): | ||
def __init__(self) -> None: | ||
self.patch_actions: list = [] | ||
self.get_actions: list = [] | ||
self.patch_actions: List = [] | ||
self.get_actions: List = [] | ||
|
||
def patch(self, route: str, data: dict[str, Any]) -> dict[str, Any]: | ||
def patch(self, route: str, data: Dict[str, Any]) -> Dict[str, Any]: | ||
self.patch_actions.append({"route": route, "data": data}) | ||
|
||
def get(self, route: str) -> dict[str, Any]: | ||
def get(self, route: str) -> Dict[str, Any]: | ||
self.get_actions.append({"route": route}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters