Commit Graph

38 Commits (352987db7e0a58c439f95278046f394ee8f1b2ff)

Author SHA1 Message Date
Shai Ungar dce51b02c8
Fix timestamp isoformat in seventeentrack (#127052)
fix timestamp isoformat
2024-09-30 11:45:54 +02:00
epenet 6d212ea24e
Add helper functions for repair tests (#125886)
* Expose repairs constants and function for other components

* Reorder

* Use helper methods

* Adjust core_files

* Improve

* Update test_migrate.py
2024-09-14 03:31:44 +02:00
Jan-Philipp Benecke 590b3d0fd4
Remove deprecated YAML import from seventeentrack (#125852) 2024-09-13 12:58:51 +02:00
Shai Ungar adda02b6b1
Add service to 17track to archive package (#123493)
* Add service archive package

* Update homeassistant/components/seventeentrack/icons.json

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* CR fix in tests

* CR fix in services.py

* string references

* extract constant keys

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-09-04 21:56:11 +02:00
Shai Ungar 978ee918cb
Use new 17track api library (#121910) 2024-07-19 17:09:50 +02:00
Shai Ungar b6609fa77c
Deprecate the dynamic package sensors in seventeentrack (#116102)
* Add deprecation comments for the dynamic package sensors

* Add deprecation comments for the dynamic package sensors

* Add deprecation comments for the dynamic package sensors

add more information when retrieving packages from service call

* Add deprecation comments for the dynamic package sensors

update deprecation comment

* 1. 17Track repair flow
2. update deprecation comment

* 1. remove description_placeholders
2. 2024.8 deprecated

* Update homeassistant/components/seventeentrack/repairs.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* 1. extract deprecated to constant
2. fix types
3. check for issue_id
4. add listener only when not deprecated
5. update which service to call

* Update homeassistant/components/seventeentrack/strings.json

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Update homeassistant/components/seventeentrack/repairs.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* 1. move deprecate_sensor_issue to where needed
2. add entry_id to issue_id
3. use constant where needed

* update breaks in ha version

* Update homeassistant/components/seventeentrack/strings.json

* Remove obsolete tests

* Fix

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-07-07 16:55:38 +02:00
Marc Mueller f11b316dac
Import Generator from collections.abc (4) (#120917) 2024-07-01 11:54:42 +02:00
Shai Ungar 03aba7e7ab
Address late seventeentrack review (#116792) 2024-06-22 10:46:31 +02:00
epenet 2e3c3789d3
Use relative imports in tests [s-z] (#119283) 2024-06-10 13:33:15 +02:00
Marc Mueller 837ee7c4fb
Import Generator from typing_extensions (4) (#118992) 2024-06-06 17:41:37 +02:00
epenet 44f715bd02
Use issue_registry fixture in component tests (#118041) 2024-05-24 15:54:20 +02:00
Shai Ungar 1f4585cc9e
Add service to 17track to get packages (#116067)
* Add service to 17track

* Add service to 17track

change to select selector
add snapshot test

* Add service to 17track

use strings for the selector

* Add service to 17track

fix test
2024-04-24 14:29:13 +02:00
Joost Lekkerkerker a45040af14
Add entity translations to 17track (#116022) 2024-04-23 22:30:20 +02:00
Shai Ungar e0c785b2b4
Add coordinator to 17Track (#115057)
* Add coordinator to 17Track

* Add coordinator to 17Track

remove SensorEntityDescription (different PR)

* Update homeassistant/components/seventeentrack/coordinator.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Update homeassistant/components/seventeentrack/sensor.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Add coordinator to 17Track

fix CR

* Add coordinator to 17Track

fix second CR

* Add coordinator to 17Track

remove commented out code + fix display name

* Add coordinator to 17Track

created a set outside _async_create_remove_entities function

* Add coordinator to 17Track

fix CR

* Add coordinator to 17Track

fix CR 2

* Update homeassistant/components/seventeentrack/coordinator.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Add coordinator to 17Track

raise UpdateFailed if API throws an exception

* Add coordinator to 17Track

merge calls

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-04-23 09:01:45 +02:00
Sid 0200d1aa66
Unignore Ruff UP006, UP007 (#115533) 2024-04-14 00:26:58 -05:00
Joost Lekkerkerker ee66f6ec8c
Use is in enum comparison in config flow tests P-T (#114675) 2024-04-02 11:21:50 -10:00
Shai Ungar 69356300f0
Address late review of 17track config flow (#114283)
* some fixes for 17track

* remove await

* fix test
2024-03-27 11:06:13 +01:00
Shai Ungar 3c06fbbd82
Add ConfigFlow for seventeentrack integration (#111196)
* Add config flow to 17Track

* Import config from configuration.yaml

* 1. move import to async_setup_platform
2. add USERNAME (email) in title for uniqueness

* Add options flow

* Add tests

* Add CONF_SHOW_ARCHIVED  and CONF_SHOW_DELIVERED to data from options

* Update homeassistant/components/seventeentrack/__init__.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Update homeassistant/components/seventeentrack/__init__.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Update homeassistant/components/seventeentrack/config_flow.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Update homeassistant/components/seventeentrack/manifest.json

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Update homeassistant/components/seventeentrack/config_flow.py

Co-authored-by: Christopher Fenner <9592452+CFenner@users.noreply.github.com>

* Update homeassistant/components/seventeentrack/__init__.py

Co-authored-by: Christopher Fenner <9592452+CFenner@users.noreply.github.com>

* Update homeassistant/components/seventeentrack/sensor.py

Co-authored-by: Christopher Fenner <9592452+CFenner@users.noreply.github.com>

* 1. Added repair issues
2. _async_validate_input inlined
3. added unique id
4. take default scan interval

* fix

* 1. move async_create_issue to async_setup_platform
2. fix tests
3. black + pylint

* combine USER_SCHEMA and OPTIONS_SCHEMA

* small fix

* remove async_setup

* fix tests and add 100% coverage

* 1. remove CONFIG_SCHEMA
2. remove error log
3. add issue with more description when import issues happen
4. some linting

* Update homeassistant/components/seventeentrack/config_flow.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Update homeassistant/components/seventeentrack/sensor.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Update homeassistant/components/seventeentrack/sensor.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Update homeassistant/components/seventeentrack/sensor.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* use freezer
use AsyncMock
fix tests

* add test_flow_fails
parametrize tests where needed
test_import_flow_already_configured - where a unique id already configured (abort flow)

* lint

* fix rebase issues

* some more fix

* 17Track revert tests and put them in a different PR

* adapt tests to MockConfigEntry

* Update tests/components/seventeentrack/test_sensor.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Update homeassistant/components/seventeentrack/sensor.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Update homeassistant/components/seventeentrack/sensor.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Update tests/components/seventeentrack/__init__.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* 1. create fixture for config and another with options
2. set options with default values
3. remove CONFIG_SCHEMA

* Update tests/components/seventeentrack/conftest.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Update tests/components/seventeentrack/conftest.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* 1. get options from import data and default if not present
2. rename mock_config_entry_no_options -> mock_config_entry_with_default_options

* move ACCOUNT_ID to mock_seventeentrack_api.return_value.profile.account_id

* Apply suggestions from code review

* Update tests/components/seventeentrack/test_config_flow.py

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
Co-authored-by: Christopher Fenner <9592452+CFenner@users.noreply.github.com>
2024-03-11 12:47:39 +01:00
Shai Ungar eb81bf1d49
Improve 17track tests (#112734)
* 17Track tests

* add 17Track sensor to coverage

* extract repeated code

* 1. _goto_future - call tick only once
2. change test name to reflect test
3. remove ifs from test

* remove undersocre from _goto_future
2024-03-10 18:57:28 +01:00
J. Nick Koston 65358c129a
Replace periodic tasks with background tasks (#112726)
* Phase out periodic tasks

* false by default or some tests will block forever, will need to fix each one manually

* kwarg works

* kwarg works

* kwarg works

* fixes

* fix more tests

* fix more tests

* fix lifx

* opensky

* pvpc_hourly_pricing

* adjust more

* adjust more

* smarttub

* adjust more

* adjust more

* adjust more

* adjust more

* adjust

* no eager executor

* zha

* qnap_qsw

* fix more

* fix fix

* docs

* its a wrapper now

* add more coverage

* coverage

* cover all combos

* more fixes

* more fixes

* more fixes

* remaining issues are legit bugs in tests

* make tplink test more predictable

* more fixes

* feedreader

* grind out some more

* make test race safe

* one more
2024-03-08 21:45:10 -05:00
Marc Mueller 7d6251ca08
Add empty line after module docstring [tests q-s] (#112711) 2024-03-08 14:47:22 +01:00
epenet ba85fdcd61
Add type hints to integration tests (q-s) (#87706) 2023-02-08 08:12:54 -08:00
Regev Brody 6176bb954c
fix: 17track package summary status is not updated when there are no more packages in that summary (#64421)
* 17track package status is not updated when there are no packages

* 17track package status is not updated when there are no packages

* 17track package status is not updated when there are no packages
2022-01-19 17:35:20 +02:00
Erik Montnemery a672dc3437
Import persistent notification (part 4) (#63901) 2022-01-11 16:57:40 +01:00
Aaron Bach a053c0a106
Bump py17track to 2021.12.1 (#60762) 2021-12-01 18:52:33 +01:00
Paulus Schoutsen a4d9019ffc
Refactor persistent notification to no longer route all data via a service (#57157)
* Convert persistent notification tests to async

* Create/dismiss persistent notifications in exposed functions, not service calls

* Fix notify persistent_notification

* Remove setting up persistent_notification

* Drop more setups

* Empty methods

* Undeprecate sync methods because too big task

* Fix setup clearing notifications

* Fix a bunch of tests

* Fix more tests

* Uno mas

* Test persistent notification events

* Clean up stale comment

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-10-07 12:58:00 +02:00
Ville Skyttä 3cd52b695d
Upgrade flake8 and dependencies, enable flake8-noqa (#48393)
* Upgrade flake8 to 3.9.0

https://flake8.pycqa.org/en/latest/release-notes/3.9.0.html

* Upgrade pydocstyle to 6.0.0

https://www.pydocstyle.org/en/latest/release_notes.html#september-13th-2020
https://www.pydocstyle.org/en/latest/release_notes.html#march-18th-2021

* Upgrade flake8-docstrings to 1.6.0, enable flake8-noqa

https://gitlab.com/pycqa/flake8-docstrings/-/blob/1.6.0/HISTORY.rst
https://github.com/plinss/flake8-noqa/issues/1

* Upgrade/pin pyflakes to 2.3.1

https://github.com/PyCQA/pyflakes/blob/2.3.1/NEWS.rst

* Pin pycodestyle to 2.7.0
2021-03-27 10:22:11 +01:00
Andreas Brett 993261e7f5
Add "timestamp" attribute to seventeentrack (#47960)
* bump py17track to 3.0.1

* Make aiohttp ClientSession optional

as introduced in py17track v3.0.0 (https://github.com/bachya/py17track/releases/tag/3.0.0)

* Update manifest.json

* add new attribute timestamp

introduced in 3.1.0

* Update requirements.txt

* Update requirements_all.txt

* Update requirements.txt

* Update requirements_test_all.txt

* Update sensor.py

* Update sensor.py

* Update manifest.json

* provide timezone configuration

user config to pre-define timezone of package status timestamps

* Update requirements_all.txt

* Update requirements_test_all.txt

* linting

* use hass.config.time_zone

* Update sensor.py

* Update test_sensor.py

* Update test_sensor.py

* black

* Update manifest.json

* adjust changes to session param

* added test against latest dev branch

* make isort happy

* make black happy

* make flake8 happy

* make black happy

* bump to 3.2.1

* 3.2.1

* Update typing 15
2021-03-19 12:34:06 +01:00
Marc Mueller 54d1e9985f
Update typing 15 (#48079) 2021-03-18 15:13:22 +01:00
Franck Nijhof 65cf2fcb6f
Drop asynctest (#44746) 2021-01-01 22:31:56 +01:00
J. Nick Koston f50976a0b3
Switch to asyncio.wait for slow update warning implementation (#41184) 2020-10-05 15:28:15 +02:00
Paulus Schoutsen 4170eb0f83
Use builtin mock (#36473) 2020-06-05 10:59:55 +02:00
Paulus Schoutsen 276f3afb00
Do async_setup_platform in background (#36244)
Co-authored-by: J. Nick Koston <nick@koston.org>
2020-05-31 22:18:30 -07:00
Paulus Schoutsen 76f392476b
Use a future for mock coro (#34989) 2020-04-30 16:31:00 -07:00
Bas Nijholt 23b92b2a56 Sort imports according to PEP8 for components starting with "S" (#29777) 2019-12-09 14:38:01 +01:00
springstan 22225cea4d Move imports to top for seventeentrack (#29264)
* Move imports to top for seventeentrack

* Updated patch target path in test_sensor.py
2019-12-01 10:19:17 -07:00
Paulus Schoutsen 4de97abc3a Black 2019-07-31 12:25:30 -07:00
Thomas Germain 4936e55979 Improve seventeentrack (#25454)
* Code improvement + tests

* review

* review + moving to pytest test function

* move test to async

* remove code comment
2019-07-28 19:55:46 +02:00