Skip to content

Commit 7cae2b9

Browse files
authored
Add requirements manually not with requirements.txt (#3)
* Add requirements manually not with requirements.txt * Add pytest-asyncio * Raise correct error * Remove unused import * Update formatting
1 parent c171c58 commit 7cae2b9

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

.github/workflows/testing.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ jobs:
2323
- name: Install dependencies
2424
run: |
2525
python -m pip install --upgrade pip
26-
pip install flake8 pytest
27-
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
26+
pip install flake8 pytest pytest-asyncio pytest-httpx yarl httpx
2827
- name: Lint with flake8
2928
run: |
3029
# stop the build if there are Python syntax errors or undefined names

elmax/__init__.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
"""Client for the Elmax Cloud services."""
22
from yarl import URL
3-
import asyncio
43
import logging
54
import httpx
65
import json
@@ -88,18 +87,18 @@ def control_panels(self):
8887
@property
8988
def endpoints(self):
9089
"""Get the endpoints."""
91-
raise NotImplemented
90+
raise NotImplementedError
9291

9392
@property
9493
def zones(self):
9594
"""Get the zones."""
9695
return self._zones
97-
96+
9897
@property
9998
def outputs(self):
10099
"""Get the outputs."""
101100
return self._outputs
102-
101+
103102
@property
104103
def areas(self):
105104
"""Get the areas."""
@@ -119,7 +118,9 @@ async def get_control_panels(self):
119118
_LOGGER.debug("Status code:", response.status_code)
120119

121120
for response_entry in response.json():
122-
control_panel = AvailableControlPanel.create_new_control_panel(response_entry)
121+
control_panel = AvailableControlPanel.create_new_control_panel(
122+
response_entry
123+
)
123124
self.registry.register(control_panel)
124125

125126
async def list_control_panels(self):
@@ -129,7 +130,11 @@ async def list_control_panels(self):
129130
control_panels_list = []
130131
for control_panel in self.registry.devices():
131132
control_panels_list.append(
132-
{"online": control_panel.online, "hash": control_panel.hash, "name": control_panel.name}
133+
{
134+
"online": control_panel.online,
135+
"hash": control_panel.hash,
136+
"name": control_panel.name,
137+
}
133138
)
134139

135140
return control_panels_list
@@ -189,6 +194,7 @@ def create_new_control_panel(response_entry):
189194
)
190195
return control_panel
191196

197+
192198
class DeviceRegistry(object):
193199
"""Representation of the devices registry."""
194200

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ pytest-cov = "^2.8.1"
3636
black = "^20.8b1"
3737
pytest = "^6"
3838
pytest-httpx = "^0.11"
39+
pytest-asyncio = "^0.14"
3940
sphinx = "^3"
4041

4142
[tool.poetry.scripts]

0 commit comments

Comments
 (0)