Remove circuit integration (#119921)

This commit is contained in:
G Johansson 2024-06-19 23:14:43 +02:00 committed by GitHub
parent f32cb8545c
commit e6967298ec
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 0 additions and 124 deletions

View File

@ -182,7 +182,6 @@ omit =
homeassistant/components/canary/camera.py homeassistant/components/canary/camera.py
homeassistant/components/cert_expiry/helper.py homeassistant/components/cert_expiry/helper.py
homeassistant/components/channels/* homeassistant/components/channels/*
homeassistant/components/circuit/*
homeassistant/components/cisco_ios/device_tracker.py homeassistant/components/cisco_ios/device_tracker.py
homeassistant/components/cisco_mobility_express/device_tracker.py homeassistant/components/cisco_mobility_express/device_tracker.py
homeassistant/components/cisco_webex_teams/notify.py homeassistant/components/cisco_webex_teams/notify.py

View File

@ -239,7 +239,6 @@ build.json @home-assistant/supervisor
/tests/components/ccm15/ @ocalvo /tests/components/ccm15/ @ocalvo
/homeassistant/components/cert_expiry/ @jjlawren /homeassistant/components/cert_expiry/ @jjlawren
/tests/components/cert_expiry/ @jjlawren /tests/components/cert_expiry/ @jjlawren
/homeassistant/components/circuit/ @braam
/homeassistant/components/cisco_ios/ @fbradyirl /homeassistant/components/cisco_ios/ @fbradyirl
/homeassistant/components/cisco_mobility_express/ @fbradyirl /homeassistant/components/cisco_mobility_express/ @fbradyirl
/homeassistant/components/cisco_webex_teams/ @fbradyirl /homeassistant/components/cisco_webex_teams/ @fbradyirl

View File

@ -1,50 +0,0 @@
"""The Unify Circuit component."""
import voluptuous as vol
from homeassistant.const import CONF_NAME, CONF_URL, Platform
from homeassistant.core import HomeAssistant
from homeassistant.helpers import config_validation as cv, discovery
import homeassistant.helpers.issue_registry as ir
from homeassistant.helpers.typing import ConfigType
DOMAIN = "circuit"
CONF_WEBHOOK = "webhook"
WEBHOOK_SCHEMA = vol.Schema(
{vol.Optional(CONF_NAME): cv.string, vol.Required(CONF_URL): cv.string}
)
CONFIG_SCHEMA = vol.Schema(
{
DOMAIN: vol.Schema(
{vol.Required(CONF_WEBHOOK): vol.All(cv.ensure_list, [WEBHOOK_SCHEMA])}
)
},
extra=vol.ALLOW_EXTRA,
)
async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
"""Set up the Unify Circuit component."""
ir.async_create_issue(
hass,
DOMAIN,
"service_removal",
breaks_in_ha_version="2024.7.0",
is_fixable=False,
is_persistent=True,
severity=ir.IssueSeverity.WARNING,
translation_key="service_removal",
translation_placeholders={"integration": "Unify Circuit", "domain": DOMAIN},
)
webhooks = config[DOMAIN][CONF_WEBHOOK]
for webhook_conf in webhooks:
hass.async_create_task(
discovery.async_load_platform(
hass, Platform.NOTIFY, DOMAIN, webhook_conf, config
)
)
return True

View File

@ -1,9 +0,0 @@
{
"domain": "circuit",
"name": "Unify Circuit",
"codeowners": ["@braam"],
"documentation": "https://www.home-assistant.io/integrations/circuit",
"iot_class": "cloud_push",
"loggers": ["circuit_webhook"],
"requirements": ["circuit-webhook==1.0.1"]
}

View File

@ -1,46 +0,0 @@
"""Unify Circuit platform for notify component."""
from __future__ import annotations
import logging
from circuit_webhook import Circuit
from homeassistant.components.notify import BaseNotificationService
from homeassistant.const import CONF_URL
from homeassistant.core import HomeAssistant
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
_LOGGER = logging.getLogger(__name__)
def get_service(
hass: HomeAssistant,
config: ConfigType,
discovery_info: DiscoveryInfoType | None = None,
) -> CircuitNotificationService | None:
"""Get the Unify Circuit notification service."""
if discovery_info is None:
return None
return CircuitNotificationService(discovery_info)
class CircuitNotificationService(BaseNotificationService):
"""Implement the notification service for Unify Circuit."""
def __init__(self, config):
"""Initialize the service."""
self.webhook_url = config[CONF_URL]
def send_message(self, message=None, **kwargs):
"""Send a message to the webhook."""
webhook_url = self.webhook_url
if webhook_url and message:
try:
circuit_message = Circuit(url=webhook_url)
circuit_message.post(text=message)
except RuntimeError as err:
_LOGGER.error("Could not send notification. Error: %s", err)

View File

@ -1,8 +0,0 @@
{
"issues": {
"service_removal": {
"title": "The {integration} integration is being removed",
"description": "The {integration} integration will be removed, as the service is no longer maintained.\n\n\n\nRemove the `{domain}` configuration from your configuration.yaml file and restart Home Assistant to fix this issue."
}
}
}

View File

@ -885,12 +885,6 @@
"config_flow": false, "config_flow": false,
"iot_class": "local_polling" "iot_class": "local_polling"
}, },
"circuit": {
"name": "Unify Circuit",
"integration_type": "hub",
"config_flow": false,
"iot_class": "cloud_push"
},
"cisco": { "cisco": {
"name": "Cisco", "name": "Cisco",
"integrations": { "integrations": {

View File

@ -648,9 +648,6 @@ cached_ipaddress==0.3.0
# homeassistant.components.caldav # homeassistant.components.caldav
caldav==1.3.9 caldav==1.3.9
# homeassistant.components.circuit
circuit-webhook==1.0.1
# homeassistant.components.cisco_mobility_express # homeassistant.components.cisco_mobility_express
ciscomobilityexpress==0.3.9 ciscomobilityexpress==0.3.9