Commit Graph

38 Commits (0dc61b34930f6fdafa3532050987431a3d317b69)

Author SHA1 Message Date
Aarni Koskela 706add4a57
Switch formatting from black to ruff-format (#102893)
Co-authored-by: Franck Nijhof <git@frenck.dev>
2023-11-27 14:38:59 +01:00
Joost Lekkerkerker e3b238861d
Clean up withings tests (#102548) 2023-10-22 21:58:30 +02:00
Joost Lekkerkerker 05ee28cae5
Clean up Withings webhook (#102038) 2023-10-15 18:00:18 +02:00
Joost Lekkerkerker 0eb4567364
Check for port in Withings webhook creation (#102026)
Check if port is really 443
2023-10-15 12:12:46 +02:00
Joost Lekkerkerker 76083a0b4c
Update Withings measurements incrementally after the first update (#102002)
* Update incrementally after the first update

* Update incrementally after the first update
2023-10-14 16:19:04 +02:00
Joost Lekkerkerker 8a4fe5add1
Use aiowithings (#101819)
* Subscribe to Withings webhooks outside of coordinator

* Subscribe to Withings webhooks outside of coordinator

* Split Withings coordinator

* Split Withings coordinator

* Use aiowithings

* Use aiowithings

* Use aiowithings

* Update homeassistant/components/withings/sensor.py

* Merge

* Remove startdate

* Minor fixes

* Bump to 0.4.1

* Fix snapshot

* Fix datapoint

* Bump to 0.4.2

* Bump to 0.4.3

* Bump to 0.4.4
2023-10-14 11:52:35 +02:00
Joost Lekkerkerker d712a29052
Split Withings coordinators (#101766)
* Subscribe to Withings webhooks outside of coordinator

* Subscribe to Withings webhooks outside of coordinator

* Split Withings coordinator

* Split Withings coordinator

* Update homeassistant/components/withings/sensor.py

* Fix merge

* Rename MEASUREMENT_COORDINATOR

* Update homeassistant/components/withings/__init__.py

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

* Apply suggestions from code review

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

* Fix feedback

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2023-10-13 07:34:31 +02:00
Joost Lekkerkerker ffb752c804
Subscribe to Withings webhooks outside of coordinator (#101759)
* Subscribe to Withings webhooks outside of coordinator

* Subscribe to Withings webhooks outside of coordinator

* Update homeassistant/components/withings/__init__.py

Co-authored-by: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/withings/__init__.py

Co-authored-by: J. Nick Koston <nick@koston.org>

---------

Co-authored-by: J. Nick Koston <nick@koston.org>
2023-10-11 00:06:42 +02:00
Joost Lekkerkerker b2cad2370b
Add Withings webhooks after a slight delay (#101542) 2023-10-06 18:21:06 +02:00
Joost Lekkerkerker 425d961489
Delete existing Withings cloudhook (#101527) 2023-10-06 13:19:39 +02:00
Joost Lekkerkerker 8b5bfd8cee
Add test helper for cloud status updates (#100993)
* Add helper for cloud status updates

* Move import
2023-09-27 17:08:51 +02:00
Joost Lekkerkerker 0f95de997f
Support cloudhooks in Withings (#100916)
* Support cloudhooks in Withings

* Support cloudhooks in Withings

* Support cloudhooks in Withings

* Remove strings
2023-09-26 21:52:18 +02:00
Joost Lekkerkerker 4ffac3e7ed
Cleanup Withings const import (#100914) 2023-09-26 13:16:37 +02:00
Joost Lekkerkerker 4f63c7934b
Add coordinator to Withings (#100378)
* Add coordinator to Withings

* Add coordinator to Withings

* Fix tests

* Remove common files

* Fix tests

* Fix tests

* Rename to Entity

* Fix

* Rename webhook handler

* Fix

* Fix external url

* Update homeassistant/components/withings/entity.py

Co-authored-by: Luke Lashley <conway220@gmail.com>

* Update homeassistant/components/withings/entity.py

Co-authored-by: Luke Lashley <conway220@gmail.com>

* Update homeassistant/components/withings/entity.py

Co-authored-by: Luke Lashley <conway220@gmail.com>

* Update homeassistant/components/withings/entity.py

Co-authored-by: Luke Lashley <conway220@gmail.com>

* fix imports

* Simplify

* Simplify

* Fix feedback

* Test if this makes changes clearer

* Test if this makes changes clearer

* Fix tests

* Remove name

* Fix feedback

---------

Co-authored-by: Luke Lashley <conway220@gmail.com>
2023-09-26 09:17:11 +02:00
Joost Lekkerkerker 6fc1407613
Extract Withings API specifics in own class (#100363)
* Extract Withings API specifics in own class

* Extract Withings API specifics in own class

* Ignore api test coverage

* fix feedback
2023-09-14 13:31:54 +02:00
Joost Lekkerkerker 8498cdfb3c
Remove profile from Withings config flow (#100202)
* Remove profile from Withings config flow

* Add config flow migration

* Add config flow migration

* Remove datamanager profile

* Remove datamanager profile

* Add manufacturer

* Remove migration

* Remove migration

* Fix feedback
2023-09-13 15:49:36 +02:00
Joost Lekkerkerker 5c206de906
Decouple Withings webhook tests from YAML (#100143) 2023-09-11 14:06:20 -05:00
epenet b38a7aabe9
Fix lingering timer in withings (#93085) 2023-05-15 21:20:20 +02:00
epenet 5b80b1f55a
Add type hints to integration tests (part 25) (#88308) 2023-02-17 16:52:28 +01:00
Franck Nijhof ed79265843
Enable Ruff PT006 (#88165)
* Enable Ruff PT006

* Adjust existing cases

* Fix tests

* Remove unneeded parentheses
2023-02-15 14:09:50 +01:00
Franck Nijhof a4fa0925b7
Small improvement to Withings tests (#86937) 2023-01-30 11:03:42 +01:00
Franck Nijhof 57cf11f067
Enable Ruff PT015 (#86775) 2023-01-27 11:10:29 +01:00
Joakim Plate 8bd4125390
Test corrections noticed during pytest upgrade (#82579)
* Withing trigger a call to coordinator after init

* Stop discovery task on STOP event

* Stop dsmr connection task on STOP

* Use autospec in modem_serial tests

close on AioSerial is non async, and should not be mocked as a coroutine

* Make sure responder is specced correctly

tests/components/emulated_hue/test_init.py::test_setup_works
  /Users/joakim/src/hass/home-assistant/homeassistant/components/emulated_hue/__init__.py:119: RuntimeWarning: coroutine 'AsyncMockMixin._execute_mock_call' was never awaited
    protocol.close()

* Don't assume Pymodbus is the only thing logging

* Use gather instead of wait

```
homeassistant/components/homeassistant/__init__.py:208: DeprecationWarning: The explicit passing of coroutine objects to asyncio.wait() is deprecated since Python 3.8, and scheduled for removal in Python 3.11.
```

* Increase wait time for automation tests

Assuming exit within 1 seconds is unreasonable on a potentially loaded
test machine.

* Avoid changing app state after startup
2022-11-23 20:53:28 +01:00
epenet ce353460b3
Fix Withings re-authentication flow (#74961) 2022-07-11 14:27:54 +02:00
Allen Porter 39ce25f76d
Add Withings application_credentials platform (#71990)
* Add Withings application_credentials platform

* Update withings auth implementation
2022-05-22 14:30:57 -07:00
Franck Nijhof f0e5e616a7
Fix device discovery of OAuth2 config flows (#48326) 2021-03-25 10:35:01 -07:00
Franck Nijhof 65cf2fcb6f
Drop asynctest (#44746) 2021-01-01 22:31:56 +01:00
Erik Montnemery 4e77969f5e
Drop use of mock_mqtt_component (#37013)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-06-23 10:17:22 -07:00
Robert Van Gorkom 5446641f09
User defined profile name for Withings (#36864) 2020-06-22 17:55:41 +02:00
Robert Van Gorkom a6a6a7b69c
Add Withings webhooks (#34447)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-06-16 20:16:18 +02:00
Quentame 1855c91988
Use CONF_CLIENT_ID & CONF_CLIENT_SECRET from homeassistant.const (#36233)
* Use CONF_CLIENT_ID & CONF_CLIENT_SECRET from homeassistant.const

* Fix pylint

* Use in tests

* Search for "client_id"

* Fix tests

* Fix test

* Fix test
2020-05-30 17:27:20 +02:00
Franck Nijhof 2223592486
Add get_url helper, deprecate base_url (#35224) 2020-05-08 02:29:47 +02:00
Paulus Schoutsen ec47216388
Use built-in test helpers on 3.8 (#34901) 2020-04-30 13:29:50 -07:00
Robert Van Gorkom ea709d0630
Remove withings sleep state (#33817) 2020-04-08 11:57:42 -07:00
springstan 67c3a4c970
Improve string formatting v7 (#33705) 2020-04-05 17:34:24 -05:00
Robert Van Gorkom 66d2f5f61d Fix withings wrong sleep state entry (#29651)
* Fixing issue where wrong sleep state entry was being used. closes #28370,#29397

* Fixing formatting.

* Sorting imports to get black checks to pass.

* Using lambda for getting latest sleep serie.
2019-12-10 21:54:50 +01:00
Robert Van Gorkom 15bedd8f27 Use latest withings_api module (#27817)
* Using latest winthings_api module.
Drastically reduced complexity of tests.

* Removing import source.

* Fixing test requirements.

* Using requests_mock instead of responses module.

* Updating file formatting.

* Removing unused method.

* Adding support for new OAuth2 config flow.

* Addressing PR feedback.
Removing unecessary base_url from config, this is a potential breaking change.

* Addressing PR feedback.
2019-10-24 09:41:04 -07:00
Robert Van Gorkom 614cf74225 Add Withings support (#25154)
* Rebasing with a clean branch.
Addressing PR feedback.
Cleaning up some static code checks.
Fixing bug with saving credentials.

* Removing unecessary change.

* Caching data manager.

* Removing configurable measures.

* Using import step in config flow.

* Updating config flows.

* Addressing PR feedback.

* Formatting source.

* Addressing PR feedback and rebasing.
2019-08-31 14:30:59 +02:00