Rename gree coordinator module (#117474)
This commit is contained in:
parent
a4ceba2e0f
commit
f188668d8a
5 changed files with 6 additions and 6 deletions
|
@ -9,7 +9,6 @@ from homeassistant.const import Platform
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers.event import async_track_time_interval
|
from homeassistant.helpers.event import async_track_time_interval
|
||||||
|
|
||||||
from .bridge import DiscoveryService
|
|
||||||
from .const import (
|
from .const import (
|
||||||
COORDINATORS,
|
COORDINATORS,
|
||||||
DATA_DISCOVERY_SERVICE,
|
DATA_DISCOVERY_SERVICE,
|
||||||
|
@ -17,6 +16,7 @@ from .const import (
|
||||||
DISPATCHERS,
|
DISPATCHERS,
|
||||||
DOMAIN,
|
DOMAIN,
|
||||||
)
|
)
|
||||||
|
from .coordinator import DiscoveryService
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,6 @@ from homeassistant.core import HomeAssistant, callback
|
||||||
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
||||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
|
|
||||||
from .bridge import DeviceDataUpdateCoordinator
|
|
||||||
from .const import (
|
from .const import (
|
||||||
COORDINATORS,
|
COORDINATORS,
|
||||||
DISPATCH_DEVICE_DISCOVERED,
|
DISPATCH_DEVICE_DISCOVERED,
|
||||||
|
@ -51,6 +50,7 @@ from .const import (
|
||||||
FAN_MEDIUM_LOW,
|
FAN_MEDIUM_LOW,
|
||||||
TARGET_TEMPERATURE_STEP,
|
TARGET_TEMPERATURE_STEP,
|
||||||
)
|
)
|
||||||
|
from .coordinator import DeviceDataUpdateCoordinator
|
||||||
from .entity import GreeEntity
|
from .entity import GreeEntity
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
|
@ -24,7 +24,7 @@ from .const import (
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class DeviceDataUpdateCoordinator(DataUpdateCoordinator): # pylint: disable=hass-enforce-coordinator-module
|
class DeviceDataUpdateCoordinator(DataUpdateCoordinator):
|
||||||
"""Manages polling for state changes from the device."""
|
"""Manages polling for state changes from the device."""
|
||||||
|
|
||||||
def __init__(self, hass: HomeAssistant, device: Device) -> None:
|
def __init__(self, hass: HomeAssistant, device: Device) -> None:
|
|
@ -3,8 +3,8 @@
|
||||||
from homeassistant.helpers.device_registry import CONNECTION_NETWORK_MAC, DeviceInfo
|
from homeassistant.helpers.device_registry import CONNECTION_NETWORK_MAC, DeviceInfo
|
||||||
from homeassistant.helpers.update_coordinator import CoordinatorEntity
|
from homeassistant.helpers.update_coordinator import CoordinatorEntity
|
||||||
|
|
||||||
from .bridge import DeviceDataUpdateCoordinator
|
|
||||||
from .const import DOMAIN
|
from .const import DOMAIN
|
||||||
|
from .coordinator import DeviceDataUpdateCoordinator
|
||||||
|
|
||||||
|
|
||||||
class GreeEntity(CoordinatorEntity[DeviceDataUpdateCoordinator]):
|
class GreeEntity(CoordinatorEntity[DeviceDataUpdateCoordinator]):
|
||||||
|
|
|
@ -20,7 +20,7 @@ def mock_setup_entry() -> Generator[AsyncMock, None, None]:
|
||||||
@pytest.fixture(autouse=True, name="discovery")
|
@pytest.fixture(autouse=True, name="discovery")
|
||||||
def discovery_fixture():
|
def discovery_fixture():
|
||||||
"""Patch the discovery object."""
|
"""Patch the discovery object."""
|
||||||
with patch("homeassistant.components.gree.bridge.Discovery") as mock:
|
with patch("homeassistant.components.gree.coordinator.Discovery") as mock:
|
||||||
mock.return_value = FakeDiscovery()
|
mock.return_value = FakeDiscovery()
|
||||||
yield mock
|
yield mock
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ def discovery_fixture():
|
||||||
def device_fixture():
|
def device_fixture():
|
||||||
"""Patch the device search and bind."""
|
"""Patch the device search and bind."""
|
||||||
with patch(
|
with patch(
|
||||||
"homeassistant.components.gree.bridge.Device",
|
"homeassistant.components.gree.coordinator.Device",
|
||||||
return_value=build_device_mock(),
|
return_value=build_device_mock(),
|
||||||
) as mock:
|
) as mock:
|
||||||
yield mock
|
yield mock
|
||||||
|
|
Loading…
Add table
Reference in a new issue