Fix connection issues with withings API by switching to a maintained codebase (#27310)

* Fixing connection issues with withings API by switching to a maintained client codebase.

* Updating requirements files.

* Adding withings api to requirements script.
This commit is contained in:
Robert Van Gorkom authored and Martin Hjelmare committed 2019-10-08 20:14:52 +02:00
1 parent 55e10d552e
commit 071476343c
10 files changed
+131 -118

No files matched your search

+6 -6
View File
@@ -1,7 +1,7 @@
"""Common data for for the withings component tests."""
import time
import nokia
import withings_api as withings
import homeassistant.components.withings.const as const
@@ -92,7 +92,7 @@ def new_measure(type_str, value, unit):
}
def nokia_sleep_response(states):
def withings_sleep_response(states):
"""Create a sleep response based on states."""
data = []
for state in states:
@@ -104,10 +104,10 @@ def nokia_sleep_response(states):
)
)
return nokia.NokiaSleep(new_sleep_data("aa", data))
return withings.WithingsSleep(new_sleep_data("aa", data))
NOKIA_MEASURES_RESPONSE = nokia.NokiaMeasures(
WITHINGS_MEASURES_RESPONSE = withings.WithingsMeasures(
{
"updatetime": "",
"timezone": "",
@@ -174,7 +174,7 @@ NOKIA_MEASURES_RESPONSE = nokia.NokiaMeasures(
)
NOKIA_SLEEP_RESPONSE = nokia_sleep_response(
WITHINGS_SLEEP_RESPONSE = withings_sleep_response(
[
const.MEASURE_TYPE_SLEEP_STATE_AWAKE,
const.MEASURE_TYPE_SLEEP_STATE_LIGHT,
@@ -183,7 +183,7 @@ NOKIA_SLEEP_RESPONSE = nokia_sleep_response(
]
)
NOKIA_SLEEP_SUMMARY_RESPONSE = nokia.NokiaSleepSummary(
WITHINGS_SLEEP_SUMMARY_RESPONSE = withings.WithingsSleepSummary(
{
"series": [
new_sleep_summary(