Commit Graph

25 Commits (135fe26704c2fce94a85d3266919bd762e394028)

Author SHA1 Message Date
epenet 0b01326f9f
Use is in ConfigEntryState enum comparison in tests (A-M) (#114925) 2024-04-05 17:16:55 +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 906d3198e3
Use is in enum comparison in config flow tests F-J (#114670)
* Use right enum expression F-J

* Fix
2024-04-02 23:01:37 +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 aa16a9d707
Add empty line after module docstring (3) (#112750) 2024-03-08 20:38:34 +01:00
Martin Hjelmare 9d5f714e29
Decrease fitbit logging verbosity on connection error (#108228)
* Add test for connection error

* Decrease fitbit connection error log verbosity
2024-01-17 07:07:02 -08:00
Allen Porter 2e4c4729c4
Improve fitbit authentication error handling (#106885) 2024-01-02 17:51:15 +01:00
Allen Porter 4752d37df7
Fix fitbit oauth reauth debug logging (#105450) 2023-12-10 23:09:58 +01:00
Allen Porter 64c9aa0cff
Update Fitbit to avoid a KeyError when `restingHeartRate` is not present (#103872)
* Update Fitbit to avoid a KeyError when `restingHeartRate` is not present

* Explicitly handle none response values
2023-11-12 12:49:49 -08:00
Allen Porter 96a19d61ab
Fix bug in Fitbit config flow, and switch to prefer display name (#103869) 2023-11-12 19:27:02 +01:00
Jan-Philipp Benecke 04a497343d
Update f-g* tests to use entity & device registry fixtures (#103841) 2023-11-12 13:07:38 +01:00
Allen Porter fe482af561
Add modernized fitbit battery level sensor (#102500)
* Add modernized fitbit battery level sensor

* Use entity names for existing battery sensors

* Use icon from device class

* Update homeassistant/components/fitbit/strings.json

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

* Update tests with lower case naming

* Swap the names of the device battery sensors

* Revert "Swap the names of the device battery sensors"

This reverts commit c9516f6d06.

* Update homeassistant/components/fitbit/sensor.py

Co-authored-by: Jan Vaníček <janvanicek@post.cz>

* Improve typing

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
Co-authored-by: Jan Vaníček <janvanicek@post.cz>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2023-11-02 10:22:27 +01:00
Allen Porter 04dfbd2e03
Improve fitbit oauth token error handling in config flow (#103131)
* Improve fitbit oauth token error handling in config flow

* Apply suggestions from code review

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

* Update tests with updated error reason

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2023-10-31 19:48:33 -07:00
Allen Porter d75f1b2b3e
Fix bug in fitbit credential import for expired tokens (#103024)
* Fix bug in fitbit credential import on token refresh

* Use stable test ids

* Update homeassistant/components/fitbit/sensor.py

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

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2023-10-29 14:26:10 -07:00
Allen Porter 8703621c64
Improve fitbit oauth import robustness (#102833)
* Improve fitbit oauth import robustness

* Improve sensor tests and remove unnecessary client check

* Fix oauth client id/secret config key checks

* Add executor for sync call
2023-10-28 17:20:44 +02:00
Allen Porter c4f562ff6a
Reduce unnecessary fitbit RPCs on startup (#102504)
* Reduce unnecessary fitbit RPCs on startup

* Update comment about racing user profile rpcs
2023-10-21 22:00:40 -07:00
Allen Porter d78ee96e2a
Update fitbit device fetch to use a data update coordinator (#101619)
* Add a fitbit device update coordinator

* Remove unnecessary debug output

* Update comments

* Update fitbit coordinator exception handling and test coverage

* Handle reauth failures in other sensors

* Fix scope changes after rebase.
2023-10-09 08:12:59 +02:00
Allen Porter 7d202f78f5
Add fitbit nutrition sensors (#101626)
* Add fitbit nutrition sensors

* Add test coverage for unit systems
2023-10-08 10:09:26 +02:00
Allen Porter c7d533d427
Update fitbit error handling (#101304)
* Update fitbit error handling

* Update exceptions to inherit HomeAssistantError and add reason code

* Revert config flow exception mapping hack
2023-10-05 22:38:15 -07:00
Allen Porter 74b3c5c690
Modernize fitbit sensors (#101179)
* Improve fitbit sensors with state class and entiy category

* Revert sensor format changes
2023-10-02 16:56:46 +02:00
Allen Porter 4e4b8de448
Add reauth support in fitbit (#101178)
* Add reauth support in fitbit

* Update tests/components/fitbit/test_config_flow.py

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

* Improve http status error code handling

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2023-10-02 08:09:08 +02:00
Allen Porter bd2fee289d
Update Fitbit integration to allow UI based configuration (#100897)
* Cleanup fitbit sensor API parsing

* Remove API code that is not used yet

* Configuration flow for fitbit

* Code cleanup after manual review

* Streamline code for review

* Use scopes to determine which entities to enable

* Use set for entity comparisons

* Apply fitbit string pr feedback

* Improve fitbit configuration flow error handling

* Apply suggestions from code review

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

* Fix typo in more places

* Revert typing import

* Revert custom domain back to default

* Add additional config flow tests

* Add         breaks_in_ha_version to repair issues

* Update homeassistant/components/fitbit/api.py

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

* Increase test coverage for token refresh success case

* Add breaks_in_ha_version for sensor issue

* Apply suggestions from code review

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

* Simplify translations, issue keys, and token refresh

* Config flow test improvements

* Simplify repair issue creation on fitbit import

* Remove unused strings

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2023-09-30 16:56:39 -07:00
Allen Porter 18f29993c5
Simplify fitbit unit system and conversions (#100825)
* Simplify fitbit unit conversions

* Use enum values in unit system schema

* Use fitbit unit system enums
2023-09-25 20:08:59 -04:00
Allen Porter ae29ddee74
Add more test coverage for fitbit sensors (#100776) 2023-09-23 15:38:53 -07:00
Allen Porter 781bc5b3bc
Add tests for fitbit integration (#100765)
* Add tests for fitbit integration

* Update coveragerc

* Update test requirements
2023-09-23 12:04:44 -07:00