Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix lingering timer in withings #93085

Merged
merged 2 commits into from
May 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion homeassistant/components/withings/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def async_call_later_callback(now) -> None:
)

# Start subscription check in the background, outside this component's setup.
async_call_later(hass, 1, async_call_later_callback)
entry.async_on_unload(async_call_later(hass, 1, async_call_later_callback))

await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)

Expand Down
6 changes: 5 additions & 1 deletion tests/components/withings/test_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,11 @@ async def test_set_config_unique_id(

config_entry = MockConfigEntry(
domain=DOMAIN,
data={"token": {"userid": "my_user_id"}, "profile": person0.profile},
data={
"token": {"userid": "my_user_id"},
"auth_implementation": "withings",
Copy link
Contributor Author

@epenet epenet May 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The missing auth_implementation here caused the config entry unload to fail for this specific test.

"profile": person0.profile,
},
)

with patch("homeassistant.components.withings.async_get_data_manager") as mock:
Expand Down