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

Bump actions/checkout from 3.2.0 to 3.3.0 #132

Open
wants to merge 2 commits into
base: vaillant
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
12 changes: 6 additions & 6 deletions .github/workflows/builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
publish: ${{ steps.version.outputs.publish }}
steps:
- name: Checkout the repository
uses: actions/checkout@v3.2.0
uses: actions/checkout@v3.3.0
with:
fetch-depth: 0

Expand Down Expand Up @@ -67,7 +67,7 @@ jobs:
if: github.repository_owner == 'home-assistant' && needs.init.outputs.publish == 'true'
steps:
- name: Checkout the repository
uses: actions/checkout@v3.2.0
uses: actions/checkout@v3.3.0

- name: Set up Python ${{ env.DEFAULT_PYTHON }}
uses: actions/[email protected]
Expand Down Expand Up @@ -100,7 +100,7 @@ jobs:
arch: ${{ fromJson(needs.init.outputs.architectures) }}
steps:
- name: Checkout the repository
uses: actions/checkout@v3.2.0
uses: actions/checkout@v3.3.0

- name: Download nightly wheels of frontend
if: needs.init.outputs.channel == 'dev'
Expand Down Expand Up @@ -198,7 +198,7 @@ jobs:
- yellow
steps:
- name: Checkout the repository
uses: actions/checkout@v3.2.0
uses: actions/checkout@v3.3.0

- name: Set build additional args
run: |
Expand Down Expand Up @@ -241,7 +241,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v3.2.0
uses: actions/checkout@v3.3.0

- name: Initialize git
uses: home-assistant/actions/helpers/git-init@master
Expand Down Expand Up @@ -280,7 +280,7 @@ jobs:
- "homeassistant"
steps:
- name: Checkout the repository
uses: actions/checkout@v3.2.0
uses: actions/checkout@v3.3.0

- name: Login to DockerHub
if: matrix.registry == 'homeassistant'
Expand Down
30 changes: 15 additions & 15 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Check out code from GitHub
uses: actions/checkout@v3.2.0
uses: actions/checkout@v3.3.0
- name: Generate partial Python venv restore key
id: generate_python_cache_key
run: >-
Expand Down Expand Up @@ -167,7 +167,7 @@ jobs:
- info
steps:
- name: Check out code from GitHub
uses: actions/checkout@v3.2.0
uses: actions/checkout@v3.3.0
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/[email protected]
Expand Down Expand Up @@ -211,7 +211,7 @@ jobs:
- pre-commit
steps:
- name: Check out code from GitHub
uses: actions/checkout@v3.2.0
uses: actions/checkout@v3.3.0
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
uses: actions/[email protected]
id: python
Expand Down Expand Up @@ -265,7 +265,7 @@ jobs:
- pre-commit
steps:
- name: Check out code from GitHub
uses: actions/checkout@v3.2.0
uses: actions/checkout@v3.3.0
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
uses: actions/[email protected]
id: python
Expand Down Expand Up @@ -322,7 +322,7 @@ jobs:
- pre-commit
steps:
- name: Check out code from GitHub
uses: actions/checkout@v3.2.0
uses: actions/checkout@v3.3.0
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
uses: actions/[email protected]
id: python
Expand Down Expand Up @@ -368,7 +368,7 @@ jobs:
- pre-commit
steps:
- name: Check out code from GitHub
uses: actions/checkout@v3.2.0
uses: actions/checkout@v3.3.0
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
uses: actions/[email protected]
id: python
Expand Down Expand Up @@ -495,7 +495,7 @@ jobs:
python-version: ${{ fromJSON(needs.info.outputs.python_versions) }}
steps:
- name: Check out code from GitHub
uses: actions/checkout@v3.2.0
uses: actions/checkout@v3.3.0
- name: Set up Python ${{ matrix.python-version }}
id: python
uses: actions/[email protected]
Expand Down Expand Up @@ -559,7 +559,7 @@ jobs:
- base
steps:
- name: Check out code from GitHub
uses: actions/checkout@v3.2.0
uses: actions/checkout@v3.3.0
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/[email protected]
Expand Down Expand Up @@ -592,7 +592,7 @@ jobs:
- base
steps:
- name: Check out code from GitHub
uses: actions/checkout@v3.2.0
uses: actions/checkout@v3.3.0
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/[email protected]
Expand Down Expand Up @@ -626,7 +626,7 @@ jobs:
- base
steps:
- name: Check out code from GitHub
uses: actions/checkout@v3.2.0
uses: actions/checkout@v3.3.0
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/[email protected]
Expand Down Expand Up @@ -671,7 +671,7 @@ jobs:
- base
steps:
- name: Check out code from GitHub
uses: actions/checkout@v3.2.0
uses: actions/checkout@v3.3.0
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/[email protected]
Expand Down Expand Up @@ -720,7 +720,7 @@ jobs:
name: Run pip check ${{ matrix.python-version }}
steps:
- name: Check out code from GitHub
uses: actions/checkout@v3.2.0
uses: actions/checkout@v3.3.0
- name: Set up Python ${{ matrix.python-version }}
id: python
uses: actions/[email protected]
Expand Down Expand Up @@ -775,7 +775,7 @@ jobs:
bluez \
ffmpeg
- name: Check out code from GitHub
uses: actions/checkout@v3.2.0
uses: actions/checkout@v3.3.0
- name: Set up Python ${{ matrix.python-version }}
id: python
uses: actions/[email protected]
Expand Down Expand Up @@ -898,7 +898,7 @@ jobs:
ffmpeg \
libmariadb-dev-compat
- name: Check out code from GitHub
uses: actions/checkout@v3.2.0
uses: actions/checkout@v3.3.0
- name: Set up Python ${{ matrix.python-version }}
id: python
uses: actions/[email protected]
Expand Down Expand Up @@ -970,7 +970,7 @@ jobs:
- pytest
steps:
- name: Check out code from GitHub
uses: actions/checkout@v3.2.0
uses: actions/checkout@v3.3.0
- name: Download all coverage artifacts
uses: actions/download-artifact@v3
- name: Upload coverage to Codecov (full coverage)
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/translations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v3.2.0
uses: actions/checkout@v3.3.0

- name: Set up Python ${{ env.DEFAULT_PYTHON }}
uses: actions/[email protected]
Expand All @@ -40,7 +40,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v3.2.0
uses: actions/checkout@v3.3.0

- name: Set up Python ${{ env.DEFAULT_PYTHON }}
uses: actions/[email protected]
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
architectures: ${{ steps.info.outputs.architectures }}
steps:
- name: Checkout the repository
uses: actions/checkout@v3.2.0
uses: actions/checkout@v3.3.0

- name: Get information
id: info
Expand Down Expand Up @@ -79,7 +79,7 @@ jobs:
arch: ${{ fromJson(needs.init.outputs.architectures) }}
steps:
- name: Checkout the repository
uses: actions/checkout@v3.2.0
uses: actions/checkout@v3.3.0

- name: Download env_file
uses: actions/download-artifact@v3
Expand Down Expand Up @@ -116,7 +116,7 @@ jobs:
arch: ${{ fromJson(needs.init.outputs.architectures) }}
steps:
- name: Checkout the repository
uses: actions/checkout@v3.2.0
uses: actions/checkout@v3.3.0

- name: Download env_file
uses: actions/download-artifact@v3
Expand Down
2 changes: 2 additions & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -733,6 +733,8 @@ build.json @home-assistant/supervisor
/homeassistant/components/msteams/ @peroyvind
/homeassistant/components/mullvad/ @meichthys
/tests/components/mullvad/ @meichthys
/homeassistant/components/multimatic/ @thomasgermain
/tests/components/multimatic/ @thomasgermain
/homeassistant/components/mutesync/ @currentoor
/tests/components/mutesync/ @currentoor
/homeassistant/components/my/ @home-assistant/core
Expand Down
116 changes: 116 additions & 0 deletions homeassistant/components/multimatic/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
"""The multimatic integration."""
import asyncio
from datetime import timedelta
import logging

from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_SCAN_INTERVAL, EVENT_HOMEASSISTANT_STOP
from homeassistant.core import HomeAssistant
from homeassistant.helpers.typing import ConfigType

from .const import (
COORDINATOR_LIST,
COORDINATORS,
DEFAULT_SCAN_INTERVAL,
DOMAIN,
PLATFORMS,
SERVICES_HANDLER,
)
from .coordinator import MultimaticApi, MultimaticCoordinator
from .service import SERVICES, MultimaticServiceHandler

_LOGGER = logging.getLogger(__name__)


async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
"""Set up the multimatic integration."""
return True


async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Set up multimatic from a config entry."""

api: MultimaticApi = MultimaticApi(hass, entry)

hass.data.setdefault(DOMAIN, {})
hass.data[DOMAIN].setdefault(entry.unique_id, {})
hass.data[DOMAIN][entry.unique_id].setdefault(COORDINATORS, {})

for coord in COORDINATOR_LIST.items():
update_interval = (
coord[1]
if coord[1]
else timedelta(
minutes=entry.options.get(CONF_SCAN_INTERVAL, DEFAULT_SCAN_INTERVAL)
)
)
m_coord = MultimaticCoordinator(
hass,
name=f"{DOMAIN}_{coord[0]}",
api=api,
method="get_" + coord[0],
update_interval=update_interval,
)
hass.data[DOMAIN][entry.unique_id][COORDINATORS][coord[0]] = m_coord
_LOGGER.debug("Adding %s coordinator", m_coord.name)
await m_coord.async_refresh()

for platform in PLATFORMS:
hass.async_create_task(
hass.config_entries.async_forward_entry_setup(entry, platform)
)

async def logout(event):
await api.logout()

hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP, logout)

await async_setup_service(api, hass)

return True


async def async_setup_service(api: MultimaticApi, hass):
"""Set up services."""
if not hass.data.get(SERVICES_HANDLER):
service_handler = MultimaticServiceHandler(api, hass)
for service_key in SERVICES:
schema = SERVICES[service_key]["schema"]
if not SERVICES[service_key].get("entity", False):
hass.services.async_register(
DOMAIN, service_key, service_handler.service_call, schema=schema
)
hass.data[DOMAIN][SERVICES_HANDLER] = service_handler


async def async_unload_services(hass):
"""Remove service when integration is removed."""
service_handler = hass.data[DOMAIN].get(SERVICES_HANDLER, None)
if service_handler:
for service_name in SERVICES:
hass.services.async_remove(DOMAIN, service_name)


async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Unload a config entry."""
unload_ok = all(
await asyncio.gather(
*(
hass.config_entries.async_forward_entry_unload(entry, component)
for component in PLATFORMS
)
)
)
if unload_ok:
hass.data[DOMAIN].pop(entry.unique_id)

_LOGGER.debug("Remaining data for multimatic %s", hass.data[DOMAIN])

if (
len(hass.data[DOMAIN]) == 1
and hass.data[DOMAIN].get(SERVICES_HANDLER, None) is not None
):
await async_unload_services(hass)
hass.data[DOMAIN].pop(SERVICES_HANDLER)

return unload_ok
Loading