Skip to content

Commit

Permalink
Update diagnostics
Browse files Browse the repository at this point in the history
  • Loading branch information
tr4nt0r committed Nov 27, 2024
1 parent 4c1bac9 commit 4af3382
Show file tree
Hide file tree
Showing 8 changed files with 1,485 additions and 504 deletions.
4 changes: 2 additions & 2 deletions homeassistant/components/habitica/diagnostics.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ async def async_get_config_entry_diagnostics(
) -> dict[str, Any]:
"""Return diagnostics for a config entry."""

habitica_data = await config_entry.runtime_data.api.user.anonymized.get()
habitica_data = await config_entry.runtime_data.habitica.get_user_anonymized()

return {
"config_entry_data": {
CONF_URL: config_entry.data[CONF_URL],
CONF_API_USER: config_entry.data[CONF_API_USER],
},
"habitica_data": habitica_data,
"habitica_data": habitica_data.to_dict()["data"],
}
2 changes: 1 addition & 1 deletion homeassistant/components/habitica/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
"documentation": "https://www.home-assistant.io/integrations/habitica",
"iot_class": "cloud_polling",
"loggers": ["habiticalib"],
"requirements": ["habiticalib==0.2.0"]
"requirements": ["habiticalib==0.3.1"]
}
2 changes: 1 addition & 1 deletion requirements_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1084,7 +1084,7 @@ ha-iotawattpy==0.1.2
ha-philipsjs==3.2.2

# homeassistant.components.habitica
habiticalib==0.2.0
habiticalib==0.3.1

# homeassistant.components.bluetooth
habluetooth==3.6.0
Expand Down
2 changes: 1 addition & 1 deletion requirements_test_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -922,7 +922,7 @@ ha-iotawattpy==0.1.2
ha-philipsjs==3.2.2

# homeassistant.components.habitica
habiticalib==0.2.0
habiticalib==0.3.1

# homeassistant.components.bluetooth
habluetooth==3.6.0
Expand Down
6 changes: 6 additions & 0 deletions tests/components/habitica/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
HabiticaTaskOrderResponse,
HabiticaTaskResponse,
HabiticaTasksResponse,
HabiticaUserAnonymizedrResponse,
HabiticaUserResponse,
NotAuthorizedError,
NotFoundError,
Expand Down Expand Up @@ -135,6 +136,11 @@ async def mock_habiticalib() -> Generator[AsyncMock]:
client.reorder_task.return_value = HabiticaTaskOrderResponse.from_dict(
{"data": [], "success": True}
)
client.get_user_anonymized.return_value = (
HabiticaUserAnonymizedrResponse.from_json(
load_fixture("anonymized.json", DOMAIN)
)
)
client.habitipy.return_value = {
"tasks": {
"user": {
Expand Down
Loading

0 comments on commit 4af3382

Please sign in to comment.