Add new tomorrow.io integration to replace Climacell (#68156)
* Add new tomorrow.io integration to replace Climacell - Part 1/3 (#57121) * Add new tomorrow.io integration to replace Climacell - Part 1/3 * remove unused code * remove extra test * remove more unused code * Remove even more unused code * Feedback * clean up options flow * clean up options flow * tweaks and fix tests * remove device_class from tomorrowio entity description class * use timestep * fix tests * always use default name but add zone name if location is in a zone * revert change that will go into future PR * review comments * move code out of try block * bump max requests to 500 as per docs * fix tests * Add new tomorrow.io integration to replace Climacell - Part 2/3 (#57124) * Add new tomorrow.io integration to replace Climacell - Part 2/3 * translations * set config flow to false in manifest * Cleanup more code and re-add options flow test * fixes * patch I/O calls * Update tests/components/climacell/test_config_flow.py Co-authored-by: Martin Hjelmare <marhje52@gmail.com> * remove unused import Co-authored-by: Martin Hjelmare <marhje52@gmail.com> * Fix codeowners * fix mypy and pylint * Switch to DeviceInfo * Fix fixture location and improve sensor entities in tomorrowio integration (#63527) * Add new tomorrow.io integration to replace Climacell - Part 3/3 (#59698) * Switch to DeviceInfo * Add new tomorrow.io integration to replace Climacell - Part 1/3 (#57121) * Add new tomorrow.io integration to replace Climacell - Part 1/3 * remove unused code * remove extra test * remove more unused code * Remove even more unused code * Feedback * clean up options flow * clean up options flow * tweaks and fix tests * remove device_class from tomorrowio entity description class * use timestep * fix tests * always use default name but add zone name if location is in a zone * revert change that will go into future PR * review comments * move code out of try block * bump max requests to 500 as per docs * fix tests * Migrate ClimaCell entries to Tomorrow.io * tweaks * pylint * Apply fix from #60454 to tomorrowio integration * lint and mypy * use speed conversion instead of distance conversion * Use SensorDeviceClass enum * Use built in conversions and remove unused loggers * fix requirements * Update homeassistant/components/tomorrowio/__init__.py Co-authored-by: Martin Hjelmare <marhje52@gmail.com> * Use constants Co-authored-by: Martin Hjelmare <marhje52@gmail.com> * Black * Update logic and add coverage * remove extra line * Do patching correctly Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
This commit is contained in:
parent
4578de68e7
commit
4cd4fbefbf
37 changed files with 4895 additions and 3576 deletions
|
@ -7,36 +7,20 @@ import pytest
|
|||
from tests.common import load_fixture
|
||||
|
||||
|
||||
@pytest.fixture(name="climacell_config_flow_connect", autouse=True)
|
||||
def climacell_config_flow_connect():
|
||||
"""Mock valid climacell config flow setup."""
|
||||
with patch(
|
||||
"homeassistant.components.climacell.config_flow.ClimaCellV3.realtime",
|
||||
return_value={},
|
||||
), patch(
|
||||
"homeassistant.components.climacell.config_flow.ClimaCellV4.realtime",
|
||||
return_value={},
|
||||
):
|
||||
yield
|
||||
|
||||
|
||||
@pytest.fixture(name="climacell_config_entry_update")
|
||||
def climacell_config_entry_update_fixture():
|
||||
"""Mock valid climacell config entry setup."""
|
||||
with patch(
|
||||
"homeassistant.components.climacell.ClimaCellV3.realtime",
|
||||
return_value=json.loads(load_fixture("climacell/v3_realtime.json")),
|
||||
return_value=json.loads(load_fixture("v3_realtime.json", "climacell")),
|
||||
), patch(
|
||||
"homeassistant.components.climacell.ClimaCellV3.forecast_hourly",
|
||||
return_value=json.loads(load_fixture("climacell/v3_forecast_hourly.json")),
|
||||
return_value=json.loads(load_fixture("v3_forecast_hourly.json", "climacell")),
|
||||
), patch(
|
||||
"homeassistant.components.climacell.ClimaCellV3.forecast_daily",
|
||||
return_value=json.loads(load_fixture("climacell/v3_forecast_daily.json")),
|
||||
return_value=json.loads(load_fixture("v3_forecast_daily.json", "climacell")),
|
||||
), patch(
|
||||
"homeassistant.components.climacell.ClimaCellV3.forecast_nowcast",
|
||||
return_value=json.loads(load_fixture("climacell/v3_forecast_nowcast.json")),
|
||||
), patch(
|
||||
"homeassistant.components.climacell.ClimaCellV4.realtime_and_all_forecasts",
|
||||
return_value=json.loads(load_fixture("climacell/v4.json")),
|
||||
return_value=json.loads(load_fixture("v3_forecast_nowcast.json", "climacell")),
|
||||
):
|
||||
yield
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue