Release 1.4.0

This commit is contained in:
2022-08-13 10:20:06 +02:00
parent 9bb72f0207
commit 5452306c72
162 changed files with 10015 additions and 4419 deletions

View File

@@ -1 +1 @@
__version__ = '1.3.0'
__version__ = '1.4.0'

View File

@@ -127,7 +127,7 @@ class TradfriService(BaseService):
characteristics=self.characteristics,
))
self.api_factory = pytradfri.api.aiocoap_api.APIFactory(
self.api_factory = await pytradfri.api.aiocoap_api.APIFactory.init(
host=self.characteristics['host'],
psk_id=psk_id,
psk=psk,

View File

@@ -357,22 +357,22 @@ class Test_TradfriService:
service.worker.return_value = fake_worker
with mock.patch('pytradfri.Gateway') as mock_gateway:
with mock.patch.object(pytradfri_api, 'APIFactory') as mock_api_factory:
with mock.patch.object(pytradfri_api.APIFactory, 'init') as mock_api_factory_init:
with mock.patch.object(service, 'set_state'):
mock_gateway.return_value = fake_gateway
mock_api_factory.return_value = fake_api_factory
mock_api_factory_init.return_value = fake_api_factory
# When
await service.start()
# Then
assert service.api_factory == fake_api_factory
pytradfri_api.APIFactory.assert_called_with(
pytradfri_api.APIFactory.init.assert_called_with(
host=characteristics['host'],
psk_id=mock.ANY,
psk=None,
)
psk_id = pytradfri_api.APIFactory.call_args.kwargs['psk_id']
psk_id = pytradfri_api.APIFactory.init.call_args.kwargs['psk_id']
assert isinstance(psk_id, str)
fake_api_factory.generate_psk.assert_called_with(
@@ -419,17 +419,17 @@ class Test_TradfriService:
service.worker.return_value = fake_worker
with mock.patch('pytradfri.Gateway') as mock_gateway:
with mock.patch.object(pytradfri_api, 'APIFactory') as mock_api_factory:
with mock.patch.object(pytradfri_api.APIFactory, 'init') as mock_api_factory_init:
with mock.patch.object(service, 'set_state'):
mock_gateway.return_value = fake_gateway
mock_api_factory.return_value = fake_api_factory
mock_api_factory_init.return_value = fake_api_factory
# When
await service.start()
# Then
assert service.api_factory == fake_api_factory
mock_api_factory.assert_called_with(
mock_api_factory_init.assert_called_with(
host=characteristics['host'],
psk_id='state_psk_id',
psk='state_psk',
@@ -464,14 +464,14 @@ class Test_TradfriService:
service.api_factory = fake_api_factory
with mock.patch('pytradfri.Gateway') as mock_gateway:
with mock.patch.object(pytradfri_api, 'APIFactory') as mock_api_factory:
with mock.patch.object(pytradfri_api.APIFactory, 'init') as mock_api_factory_init:
with mock.patch.object(service, 'set_state'):
# When
await service.start()
# Then
assert service.api_factory == fake_api_factory
assert not mock_api_factory.called
assert not mock_api_factory_init.called
assert not fake_api_factory.generate_psk.called
@@ -503,16 +503,13 @@ class Test_TradfriService:
fake_api_factory = mock.Mock(spec=pytradfri_api.APIFactory)
service.api_factory = fake_api_factory
with mock.patch('pytradfri.Gateway'):
with mock.patch.object(pytradfri_api, 'APIFactory'):
with mock.patch.object(service, 'set_state'):
# When
await service.stop()
# When
await service.stop()
# Then
assert service.api_factory is None
assert service.gateway is None
assert service.job.close.called
# Then
assert service.api_factory is None
assert service.gateway is None
assert service.job.close.called
async def test_stop_already_stopped(self, homehub_app):
# Given
@@ -531,11 +528,8 @@ class Test_TradfriService:
fake_api_factory = mock.Mock(spec=pytradfri_api.APIFactory)
service.api_factory = fake_api_factory
with mock.patch('pytradfri.Gateway'):
with mock.patch.object(pytradfri_api, 'APIFactory'):
with mock.patch.object(service, 'set_state'):
# When
await service.stop()
# When
await service.stop()
# Then
assert not service.job.close.called
# Then
assert not service.job.close.called

View File

@@ -1,6 +1,6 @@
{
"name": "@bthlabs/homehub-tradfri",
"version": "1.3.0",
"version": "1.4.0",
"description": "BTHLabs HomeHub - IKEA Tradfri Integration",
"main": "lib/index.js",
"author": "BTHLabs <contact@bthlabs.pl>",
@@ -20,9 +20,9 @@
"registry": "https://nexus.bthlabs.pl/repository/npm-hosted/"
},
"peerDependencies": {
"@bthlabs/homehub-components": ">=1.3.0",
"@bthlabs/homehub-core": ">=1.3.0",
"@bthlabs/homehub-icons": ">=1.3.0",
"@bthlabs/homehub-components": ">=1.4.0,<2.0.0",
"@bthlabs/homehub-core": ">=1.4.0,<2.0.0",
"@bthlabs/homehub-icons": ">=1.4.0,<2.0.0",
"react": ">=16.11.0",
"react-bootstrap": "1.0.1",
"react-dom": ">=16.11.0"
@@ -34,9 +34,9 @@
"@babel/preset-env": "7.7.1",
"@babel/preset-react": "7.7.0",
"@bthlabs/eslint-config": "1.0.3",
"@bthlabs/homehub-components": ">=1.2.0",
"@bthlabs/homehub-core": ">=1.2.0",
"@bthlabs/homehub-icons": ">=1.2.0",
"@bthlabs/homehub-components": "1.4.0",
"@bthlabs/homehub-core": "1.4.0",
"@bthlabs/homehub-icons": "1.4.0",
"babel-eslint": "10.0.3",
"babel-loader": "8.0.6",
"classnames": "2.2.6",
@@ -57,7 +57,6 @@
"karma-sourcemap-loader": "0.3.7",
"karma-webpack": "4.0.2",
"lodash": "4.17.15",
"node-sass": "4.14.1",
"null-loader": "4.0.0",
"prop-types": "15.7.2",
"react": "16.11.0",
@@ -66,6 +65,7 @@
"react-svg-loader": "3.0.3",
"regenerator-runtime": "0.13.5",
"sass-loader": "8.0.2",
"sass": "^1.3.2",
"style-loader": "1.2.1",
"underscore": "1.9.1",
"webpack": "4.41.2",

View File

@@ -3,8 +3,8 @@ factory-boy==3.2.0
flake8==3.8.3
flake8-commas==2.0.0
pycodestyle==2.6.0
pytest==6.0.1
pytest-aiohttp==0.3.0
pytest-asyncio==0.14.0
pytest==7.1.2
pytest-aiohttp==1.0.4
pytest-asyncio==0.18.3
pytest-env==0.6.2
twine==2.0.0

View File

@@ -1,2 +1,2 @@
homehub_backend>=1.3.0
pytradfri[async]==6.4.0
homehub_backend>=1.4.0
pytradfri[async]==7.2.1

File diff suppressed because it is too large Load Diff