8000 Add Gaposa integration by mwatson2 · Pull Request #138754 · home-assistant/core · GitHub
[go: up one dir, main page]

Skip to content

Add Gaposa integration #138754

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

Draft
wants to merge 17 commits into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Gaposa Integration: Update for latest requirements
  • Loading branch information
mwatson2 committed Feb 8, 2025
commit 1effeec99d9c81f2910eb2aab7923b8b7f5a96d9
11 changes: 11 additions & 0 deletions homeassistant/components/gaposa/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
update_interval=timedelta(seconds=UPDATE_INTERVAL),
)

# Store runtime data that should persist between restarts
entry.async_on_unload(entry.add_update_listener(update_listener))
Comment on lines +37 to +38
Copy link
Member

Choose a reason for hiding this comment

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

can be removed

entry.runtime_data = {
"last_update": None
} # Add any runtime data you want to persist

hass.data[DOMAIN][entry.entry_id] = (gaposa, coordinator)

# Fetch initial data so we have data when entities subscribe
Expand All @@ -62,6 +68,11 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
return True


async def update_listener(hass: HomeAssistant, entry: ConfigEntry) -> None:
"""Handle options update."""
# Add any code needed to handle configuration updates


async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Unload a config entry."""
if unload_ok := await hass.config_entries.async_unload_platforms(entry, PLATFORMS):
Expand Down
6 changes: 2 additions & 4 deletions homeassistant/components/gaposa/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@
"config_flow": true,
"dependencies": [],
"documentation": "https://www.home-assistant.io/integrations/gaposa",
"homekit": {},
"integration_type": "hub",
"iot_class": "cloud_polling",
"loggers": ["gaposa"],
"requirements": ["pygaposa==0.2.3"],
"ssdp": [],
"zeroconf": []
"quality_scale": "bronze",
"requirements": ["pygaposa==0.2.3"]
}
19 changes: 19 additions & 0 deletions homeassistant/components/gaposa/quality_scale.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
rules:
action-setup: "done"
appropriate-polling: "done"
brands: "done"
common-modules: "done"
config-flow: "done"
config-flow-test-coverage: "done"
dependency-transparency: "done"
docs-actions: "done"
docs-high-level-description: "done"
docs-installation-instructions: "done"
docs-removal-instructions: "done"
entity-event-setup: "done"
entity-unique-id: "done"
has-entity-name: "done"
runtime-data: "done"
test-before-configure: "done"
test-before-setup: "done"
unique-config-entry: "done"
Copy link
Member

Choose a reason for hiding this comment

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

Please add the full yaml file

4 changes: 4 additions & 0 deletions homeassistant/generated/integrations.json
Original file line number Diff line number Diff line change
Expand Up @@ -2131,6 +2131,10 @@
},
"fyta": {
"name": "FYTA",
"integration_type": "hub",
"config_flow": true,
"iot_class": "cloud_polling"
},
"gaposa": {
"name": "Gaposa",
"integration_type": "hub",
Expand Down
0