Add DataUpdateCoordinator to met integration (#38405)
* Add DataUpdateCoordinator to met integration * isort * redundant fetch_data * Update homeassistant/components/met/weather.py Co-authored-by: Chris Talkington <chris@talkingtontech.com> * Update homeassistant/components/met/weather.py Co-authored-by: Chris Talkington <chris@talkingtontech.com> * Update homeassistant/components/met/__init__.py Co-authored-by: Chris Talkington <chris@talkingtontech.com> * Update homeassistant/components/met/__init__.py Co-authored-by: Chris Talkington <chris@talkingtontech.com> * Update homeassistant/components/met/__init__.py Co-authored-by: Chris Talkington <chris@talkingtontech.com> * Update homeassistant/components/met/__init__.py Co-authored-by: Chris Talkington <chris@talkingtontech.com> * Update homeassistant/components/met/weather.py Co-authored-by: Chris Talkington <chris@talkingtontech.com> * Update homeassistant/components/met/__init__.py Co-authored-by: Chris Talkington <chris@talkingtontech.com> * Update homeassistant/components/met/__init__.py Co-authored-by: Chris Talkington <chris@talkingtontech.com> * Update homeassistant/components/met/__init__.py Co-authored-by: Chris Talkington <chris@talkingtontech.com> * Update homeassistant/components/met/__init__.py Co-authored-by: Chris Talkington <chris@talkingtontech.com> * Update homeassistant/components/met/__init__.py Co-authored-by: Chris Talkington <chris@talkingtontech.com> * Update homeassistant/components/met/weather.py Co-authored-by: Chris Talkington <chris@talkingtontech.com> * Update homeassistant/components/met/weather.py Co-authored-by: Chris Talkington <chris@talkingtontech.com> * fix black, isort, flake8, hassfest, mypy * remove unused async_setup method * replace fetch_data by coordinator request_refresh * remove redundant async_update * track_home * Apply suggestions from code review * Apply suggestions from code review * Update homeassistant/components/met/__init__.py * Apply suggestions from code review * Update homeassistant/components/met/__init__.py * Apply suggestions from code review * Update homeassistant/components/met/__init__.py * Apply suggestions from code review * Update test_config_flow.py * Apply suggestions from code review * Apply suggestions from code review * Update __init__.py * Create test_init.py * Update homeassistant/components/met/__init__.py * Update __init__.py * Update __init__.py * Update homeassistant/components/met/__init__.py Co-authored-by: Chris Talkington <chris@talkingtontech.com>
This commit is contained in:
1 parent
761067559d
commit
b258e757c2
6 files changed
+227
-96
No files matched your search
@@ -103,3 +103,21 @@ async def test_onboarding_step(hass):
|
||||
assert result["type"] == "create_entry"
|
||||
assert result["title"] == HOME_LOCATION_NAME
|
||||
assert result["data"] == {"track_home": True}
|
||||
|
||||
|
||||
async def test_import_step(hass):
|
||||
"""Test initializing via import step."""
|
||||
test_data = {
|
||||
"name": "home",
|
||||
CONF_LONGITUDE: None,
|
||||
CONF_LATITUDE: None,
|
||||
CONF_ELEVATION: 0,
|
||||
"track_home": True,
|
||||
}
|
||||
result = await hass.config_entries.flow.async_init(
|
||||
DOMAIN, context={"source": "import"}, data=test_data
|
||||
)
|
||||
|
||||
assert result["type"] == "create_entry"
|
||||
assert result["title"] == "home"
|
||||
assert result["data"] == test_data
|
||||
Reference in new issue
Block a user