mirror of
https://github.com/home-assistant/core.git
synced 2025-07-24 21:57:51 +00:00
Restore control4 integration (#124750)
* Revert "Disable control4 integration (#124746)" This reverts commit 16dd6b1712f55a19dece113e0a8d32da2d3d0309. * Restore control4 integration reverts #124746 and updates the lib instead changelog: https://github.com/lawtancool/pyControl4/compare/v1.1.0...v1.1.3 Note that there is no release yet, see https://github.com/lawtancool/pyControl4/pull/32 * Apply suggestions from code review
This commit is contained in:
parent
e720a14dc4
commit
42388450e1
@ -1,7 +1,5 @@
|
|||||||
"""The Control4 integration."""
|
"""The Control4 integration."""
|
||||||
|
|
||||||
# mypy: ignore-errors
|
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import json
|
import json
|
||||||
@ -9,10 +7,10 @@ import logging
|
|||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
from aiohttp import client_exceptions
|
from aiohttp import client_exceptions
|
||||||
|
from pyControl4.account import C4Account
|
||||||
|
from pyControl4.director import C4Director
|
||||||
|
from pyControl4.error_handling import BadCredentials
|
||||||
|
|
||||||
# from pyControl4.account import C4Account
|
|
||||||
# from pyControl4.director import C4Director
|
|
||||||
# from pyControl4.error_handling import BadCredentials
|
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
CONF_HOST,
|
CONF_HOST,
|
||||||
|
@ -1,17 +1,14 @@
|
|||||||
"""Config flow for Control4 integration."""
|
"""Config flow for Control4 integration."""
|
||||||
|
|
||||||
# mypy: ignore-errors
|
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
from aiohttp.client_exceptions import ClientError
|
from aiohttp.client_exceptions import ClientError
|
||||||
|
from pyControl4.account import C4Account
|
||||||
# from pyControl4.account import C4Account
|
from pyControl4.director import C4Director
|
||||||
# from pyControl4.director import C4Director
|
from pyControl4.error_handling import NotFound, Unauthorized
|
||||||
# from pyControl4.error_handling import NotFound, Unauthorized
|
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
from homeassistant.config_entries import (
|
from homeassistant.config_entries import (
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
"""Provides data updates from the Control4 controller for platforms."""
|
"""Provides data updates from the Control4 controller for platforms."""
|
||||||
# mypy: ignore-errors
|
|
||||||
|
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
import logging
|
import logging
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
# from pyControl4.account import C4Account
|
from pyControl4.account import C4Account
|
||||||
# from pyControl4.director import C4Director
|
from pyControl4.director import C4Director
|
||||||
# from pyControl4.error_handling import BadToken
|
from pyControl4.error_handling import BadToken
|
||||||
|
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import CONF_HOST, CONF_PASSWORD, CONF_TOKEN, CONF_USERNAME
|
from homeassistant.const import CONF_HOST, CONF_PASSWORD, CONF_TOKEN, CONF_USERNAME
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
"""Platform for Control4 Lights."""
|
"""Platform for Control4 Lights."""
|
||||||
|
|
||||||
# mypy: ignore-errors
|
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
@ -9,8 +7,9 @@ from datetime import timedelta
|
|||||||
import logging
|
import logging
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
# from pyControl4.error_handling import C4Exception
|
from pyControl4.error_handling import C4Exception
|
||||||
# from pyControl4.light import C4Light
|
from pyControl4.light import C4Light
|
||||||
|
|
||||||
from homeassistant.components.light import (
|
from homeassistant.components.light import (
|
||||||
ATTR_BRIGHTNESS,
|
ATTR_BRIGHTNESS,
|
||||||
ATTR_TRANSITION,
|
ATTR_TRANSITION,
|
||||||
|
@ -3,11 +3,10 @@
|
|||||||
"name": "Control4",
|
"name": "Control4",
|
||||||
"codeowners": ["@lawtancool"],
|
"codeowners": ["@lawtancool"],
|
||||||
"config_flow": true,
|
"config_flow": true,
|
||||||
"disabled": "This integration is disabled because it uses an old version of socketio.",
|
|
||||||
"documentation": "https://www.home-assistant.io/integrations/control4",
|
"documentation": "https://www.home-assistant.io/integrations/control4",
|
||||||
"iot_class": "local_polling",
|
"iot_class": "local_polling",
|
||||||
"loggers": ["pyControl4"],
|
"loggers": ["pyControl4"],
|
||||||
"requirements": ["pyControl4==1.1.0"],
|
"requirements": ["pyControl4==1.2.0"],
|
||||||
"ssdp": [
|
"ssdp": [
|
||||||
{
|
{
|
||||||
"st": "c4:director"
|
"st": "c4:director"
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
"""Platform for Control4 Rooms Media Players."""
|
"""Platform for Control4 Rooms Media Players."""
|
||||||
|
|
||||||
# mypy: ignore-errors
|
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
@ -10,8 +8,9 @@ import enum
|
|||||||
import logging
|
import logging
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
# from pyControl4.error_handling import C4Exception
|
from pyControl4.error_handling import C4Exception
|
||||||
# from pyControl4.room import C4Room
|
from pyControl4.room import C4Room
|
||||||
|
|
||||||
from homeassistant.components.media_player import (
|
from homeassistant.components.media_player import (
|
||||||
MediaPlayerDeviceClass,
|
MediaPlayerDeviceClass,
|
||||||
MediaPlayerEntity,
|
MediaPlayerEntity,
|
||||||
|
@ -1,5 +0,0 @@
|
|||||||
extend = "../../../pyproject.toml"
|
|
||||||
|
|
||||||
lint.extend-ignore = [
|
|
||||||
"F821"
|
|
||||||
]
|
|
@ -1685,6 +1685,9 @@ pyAtome==0.1.1
|
|||||||
# homeassistant.components.hdmi_cec
|
# homeassistant.components.hdmi_cec
|
||||||
pyCEC==0.5.2
|
pyCEC==0.5.2
|
||||||
|
|
||||||
|
# homeassistant.components.control4
|
||||||
|
pyControl4==1.2.0
|
||||||
|
|
||||||
# homeassistant.components.duotecno
|
# homeassistant.components.duotecno
|
||||||
pyDuotecno==2024.5.1
|
pyDuotecno==2024.5.1
|
||||||
|
|
||||||
|
@ -1368,6 +1368,9 @@ py-synologydsm-api==2.5.2
|
|||||||
# homeassistant.components.hdmi_cec
|
# homeassistant.components.hdmi_cec
|
||||||
pyCEC==0.5.2
|
pyCEC==0.5.2
|
||||||
|
|
||||||
|
# homeassistant.components.control4
|
||||||
|
pyControl4==1.2.0
|
||||||
|
|
||||||
# homeassistant.components.duotecno
|
# homeassistant.components.duotecno
|
||||||
pyDuotecno==2024.5.1
|
pyDuotecno==2024.5.1
|
||||||
|
|
||||||
|
@ -1,5 +0,0 @@
|
|||||||
extend = "../../../pyproject.toml"
|
|
||||||
|
|
||||||
lint.extend-ignore = [
|
|
||||||
"F821"
|
|
||||||
]
|
|
@ -1,13 +1,11 @@
|
|||||||
"""Test the Control4 config flow."""
|
"""Test the Control4 config flow."""
|
||||||
|
|
||||||
# mypy: ignore-errors
|
|
||||||
from unittest.mock import AsyncMock, patch
|
from unittest.mock import AsyncMock, patch
|
||||||
|
|
||||||
import pytest
|
from pyControl4.account import C4Account
|
||||||
|
from pyControl4.director import C4Director
|
||||||
|
from pyControl4.error_handling import Unauthorized
|
||||||
|
|
||||||
# from pyControl4.account import C4Account
|
|
||||||
# from pyControl4.director import C4Director
|
|
||||||
# from pyControl4.error_handling import Unauthorized
|
|
||||||
from homeassistant import config_entries
|
from homeassistant import config_entries
|
||||||
from homeassistant.components.control4.const import DEFAULT_SCAN_INTERVAL, DOMAIN
|
from homeassistant.components.control4.const import DEFAULT_SCAN_INTERVAL, DOMAIN
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
@ -18,6 +16,7 @@ from homeassistant.const import (
|
|||||||
)
|
)
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.data_entry_flow import FlowResultType
|
from homeassistant.data_entry_flow import FlowResultType
|
||||||
|
|
||||||
from tests.common import MockConfigEntry
|
from tests.common import MockConfigEntry
|
||||||
|
|
||||||
|
|
||||||
@ -42,7 +41,6 @@ def _get_mock_c4_director():
|
|||||||
return c4_director_mock
|
return c4_director_mock
|
||||||
|
|
||||||
|
|
||||||
@pytest.skip(allow_module_level=True)
|
|
||||||
async def test_form(hass: HomeAssistant) -> None:
|
async def test_form(hass: HomeAssistant) -> None:
|
||||||
"""Test we get the form."""
|
"""Test we get the form."""
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user