Commit Graph

30 Commits (6c7ac7a6ef5bbe48b10576d3f0398be1af29b441)

Author SHA1 Message Date
Manu 27e81fe0ed
Improve error messages in Habitica (#129948)
Improve error messages
2024-11-06 13:23:43 +01:00
Manu 9253fa4471
Add binary sensor platform to Habitica integration (#129613)
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-11-05 17:01:38 +01:00
Manu f5a2ec961d
Remove unused snapshots from Habitica (#129499) 2024-10-30 15:44:21 +01:00
Manu 6887a4419e
Add calendar platform to Habitica integration (#128248)
* Add calendar platform

* Add tests

* add missing reminders filter by date

* Add +1 day to todo end

* add 1 day to dailies, remove unused line of code

* Removing reminders calendar to a separate PR

* fix upcoming event for dailies

* util function for rrule string

* Add test for get_recurrence_rule

* use habitica daystart and account for isDue flag

* yesterdaily is still an active event

* Fix yesterdailies and add attribute

* Update snapshot

* Use iter, return attribute with None value

* various changes

* update snapshot

* fix merge error

* update snapshot

* change date range filtering for todos

* use datetimes instead of date in async_get_events

* Sort events

* Update snapshot

* add method for todos

* filter for upcoming events

* dailies

* refactor todos

* update dailies logic

* dedent loops
2024-10-29 20:53:49 -07:00
Manu e602a464db
Add tests for buttons in Habitica integration (#128194)
* Add tests for button platform

* update tests

* Add skill buttons

* Assert state, add fixtures/parametrization

* entity as list
2024-10-29 19:03:41 +01:00
Manu c264ee22e7
Add tests for switch platform of Habitica integration (#128204) 2024-10-29 14:08:05 +01:00
Manu fdded9e7ee
Add tests for todo platform of Habitica integration (#128199)
* Add tests for todo platform

* refactor mock_called_with

* update tests
2024-10-26 10:48:07 -07:00
Manu 8665f4a251
Refactor services setup in Habitica integration (#128186) 2024-10-25 11:00:58 +02:00
Manu 8540343d7f
Add tests for Habitica integration (#126445)
* Add tests for sensor platform

* Add tests for switch platform

* Add tests for button platform

* Add tests for todo platform

* Add tests for todo platform

* Load json data fixtures

* Update snapshot

* Add fixtures

* test move todo

* parametrize todo tests, test drop notification

* test todo exceptions

* some minor improvements

* test setup retry

* Test update failed

* Test coordinator rate limit

* Test date utils

* Reduce scope of PR

* remove unused assert_mock_called_with  function

* update snapshot

* Update tests/components/habitica/test_init.py

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-10-11 20:03:23 +02:00
Manu fa53ec40d6
Remove deprecated yaml import from Habitica (#127946) 2024-10-09 11:17:19 +02:00
Mr. Bubbles b787c2617b
Revert "Fix missing id in Habitica completed todos API response" (#126142)
Revert "Fix missing id in Habitica completed todos API response (#124565)"

This reverts commit c9e7c76ee5.
2024-09-19 10:59:54 +02:00
Mr. Bubbles 50577883dc
Add option to login with username/email and password in Habitica integration (#117622)
* add login/password authentication

* add advanced config flow

* remove unused exception classes, fix errors

* update username in init

* update tests

* update strings

* combine steps with menu

* remove username from entry

* update tests

* Revert "update tests"

This reverts commit 6ac8ad6a26547b623e217db817ec4d0cf8c91f1d.

* Revert "remove username from entry"

This reverts commit d9323fb72df3f9d41be0a53bb0cbe16be718d005.

* small changes

* remove pylint broad-excep

* run habitipy init in executor

* Add text selectors

* changes
2024-08-30 17:08:06 +02:00
Mr. Bubbles c9e7c76ee5
Fix missing id in Habitica completed todos API response (#124565)
* Fix missing id in completed todos API response

* Copy id only if none

* Update homeassistant/components/habitica/coordinator.py

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>

---------

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2024-08-25 15:15:47 +02:00
Mr. Bubbles 751935539a
Migrate Habitica Dailies and To-Do's to the todo platform (#116655)
* Add todo platform

* update for DataUpdateCoordinator

* set lastCron as dailies due date

* parse alternative duedate format

* fix tests

* send notification on item drop

* fix drop message

* update exception messages

* Simplified the update of user_fields by using set union

* move userFields to const

* Issue deprecation only if entity is acutally used

* Resolve issues

* user entity registry to get entity_id

* raise ServiceValidationError

* requested changes

* Move next_due_date helper function to util.py module

* some changes

* Move function to util.py
2024-07-07 17:50:27 +02:00
epenet 411630429d
Improve type hints in habitica tests (#121212) 2024-07-04 16:27:57 +02:00
epenet d10362e226
Add AiohttpClientMocker type hints in tests (#118373) 2024-05-29 14:38:46 +02:00
Mr. Bubbles d81fad1ef1
Reduce API calls to fetch Habitica tasks (#116897) 2024-05-06 08:02:54 -05:00
Mr. Bubbles b53081dc51
Add update coordinator for Habitica integration (#116427)
* Add DataUpdateCoordinator and exception handling for service

* remove unnecessary lines

* revert changes to service

* remove type check

* store coordinator in config_entry

* add exception translations

* update HabiticaData

* Update homeassistant/components/habitica/__init__.py

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

* Update homeassistant/components/habitica/sensor.py

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

* remove auth exception

* fixes

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-05-05 17:02:28 +02:00
Joost Lekkerkerker b9281327c4
Use FlowResultType enum in config flow tests A-M (#114681) 2024-04-03 09:21:17 +02:00
Joost Lekkerkerker 6bb4e7d62c
Bump ruff to 0.3.4 (#112690)
Co-authored-by: Sid <27780930+autinerd@users.noreply.github.com>
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-03-26 00:02:16 +01:00
Marc Mueller c88b337600
Add empty line after module docstring [tests f-k] (#112709) 2024-03-08 14:50:04 +01:00
Allen Porter 12129e9d21
Update service call return values and error handling (#94657)
* Update return signature of service calls

* Add timeout error handling in websocket api for service calls

* Update recorder tests to remove assertion on service call

* Remove timeout behavior and update callers that depend on it today

* Fix tests

* Add missing else

* await coro directly

* Fix more tests

* Update the intent task to use wait instead of timeout

* Remove script service call limits and limit constants

* Update tests that depend on service call limits

* Use wait instead of wait_for and add test

* Update homeassistant/helpers/intent.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

---------

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2023-06-16 07:01:40 -07:00
epenet 89e4ee5320
Add type hints to integration tests (part 8) (#87982) 2023-02-13 11:13:48 +01:00
epenet 37a2040d7b
Add type hints to integration tests (h-i) (#87703) 2023-02-08 18:12:56 +01:00
J. Nick Koston c96781a795
Prevent plumbum from causing the testsuite to fail (#70400) 2022-04-22 08:40:23 +02:00
Ville Skyttä b52c5c82b1
Use http.HTTPStatus in components/[gh]* (#58246) 2021-10-23 20:34:53 +02: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
Pavel Pletenev db2fda09b9
Fix habitica regression (#52097) 2021-06-26 15:36:45 -07:00
Martin Hjelmare 43a5852561
Fix habitica entry unload clean up (#46798)
* Fix habitica entry unload clean up

* Fix service remove

* Add entry setup and unload test

* Fix config flow tests

* Assert service
2021-02-20 20:59:59 +01:00
Ilja Leiko 8c72cb6163
Add sensors to fetch Habitica tasks (#38910)
* Adding sensors to fetch habitica tasks

* PR changes and rebase

* Fixing pylint

* Fixing failed test dependancy

* Generating requirements

* Apply suggestions from code review

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* PR changes

* Update homeassistant/components/habitica/config_flow.py

Thank you, @MartinHjelmare

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* PR Changes

* Fix failing test

* Update tests/components/habitica/test_config_flow.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Fixing linting and imports

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-02-17 09:04:11 +01:00