Bumb python-homewizard-energy to 7.0.0 (#131366)

This commit is contained in:
Duco Sebel 2024-11-23 20:29:03 +01:00 committed by GitHub
parent e6715fd4d7
commit 1e313c6ff5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
10 changed files with 19 additions and 19 deletions

View File

@ -6,9 +6,9 @@ from collections.abc import Mapping
import logging
from typing import Any, NamedTuple
from homewizard_energy import HomeWizardEnergy
from homewizard_energy import HomeWizardEnergyV1
from homewizard_energy.errors import DisabledError, RequestError, UnsupportedError
from homewizard_energy.models import Device
from homewizard_energy.v1.models import Device
from voluptuous import Required, Schema
from homeassistant.components import onboarding, zeroconf
@ -177,7 +177,7 @@ class HomeWizardConfigFlow(ConfigFlow, domain=DOMAIN):
Make connection with device to test the connection
and to get info for unique_id.
"""
energy_api = HomeWizardEnergy(ip_address)
energy_api = HomeWizardEnergyV1(ip_address)
try:
return await energy_api.device()

View File

@ -6,7 +6,7 @@ from dataclasses import dataclass
from datetime import timedelta
import logging
from homewizard_energy.models import Data, Device, State, System
from homewizard_energy.v1.models import Data, Device, State, System
from homeassistant.const import Platform

View File

@ -4,10 +4,10 @@ from __future__ import annotations
import logging
from homewizard_energy import HomeWizardEnergy
from homewizard_energy.const import SUPPORTS_IDENTIFY, SUPPORTS_STATE
from homewizard_energy import HomeWizardEnergyV1
from homewizard_energy.errors import DisabledError, RequestError, UnsupportedError
from homewizard_energy.models import Device
from homewizard_energy.v1.const import SUPPORTS_IDENTIFY, SUPPORTS_STATE
from homewizard_energy.v1.models import Device
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_IP_ADDRESS
@ -23,7 +23,7 @@ _LOGGER = logging.getLogger(__name__)
class HWEnergyDeviceUpdateCoordinator(DataUpdateCoordinator[DeviceResponseEntry]):
"""Gather data for the energy device."""
api: HomeWizardEnergy
api: HomeWizardEnergyV1
api_disabled: bool = False
_unsupported_error: bool = False
@ -36,7 +36,7 @@ class HWEnergyDeviceUpdateCoordinator(DataUpdateCoordinator[DeviceResponseEntry]
) -> None:
"""Initialize update coordinator."""
super().__init__(hass, _LOGGER, name=DOMAIN, update_interval=UPDATE_INTERVAL)
self.api = HomeWizardEnergy(
self.api = HomeWizardEnergyV1(
self.config_entry.data[CONF_IP_ADDRESS],
clientsession=async_get_clientsession(hass),
)

View File

@ -6,6 +6,6 @@
"documentation": "https://www.home-assistant.io/integrations/homewizard",
"iot_class": "local_polling",
"loggers": ["homewizard_energy"],
"requirements": ["python-homewizard-energy==v6.3.0"],
"requirements": ["python-homewizard-energy==v7.0.0"],
"zeroconf": ["_hwenergy._tcp.local."]
}

View File

@ -6,7 +6,7 @@ from collections.abc import Callable
from dataclasses import dataclass
from typing import Final
from homewizard_energy.models import Data, ExternalDevice
from homewizard_energy.v1.models import Data, ExternalDevice
from homeassistant.components.sensor import (
DEVICE_CLASS_UNITS,

View File

@ -6,7 +6,7 @@ from collections.abc import Awaitable, Callable
from dataclasses import dataclass
from typing import Any
from homewizard_energy import HomeWizardEnergy
from homewizard_energy import HomeWizardEnergyV1
from homeassistant.components.switch import (
SwitchDeviceClass,
@ -31,7 +31,7 @@ class HomeWizardSwitchEntityDescription(SwitchEntityDescription):
available_fn: Callable[[DeviceResponseEntry], bool]
create_fn: Callable[[HWEnergyDeviceUpdateCoordinator], bool]
is_on_fn: Callable[[DeviceResponseEntry], bool | None]
set_fn: Callable[[HomeWizardEnergy, bool], Awaitable[Any]]
set_fn: Callable[[HomeWizardEnergyV1, bool], Awaitable[Any]]
SWITCHES = [

View File

@ -2347,7 +2347,7 @@ python-gitlab==1.6.0
python-homeassistant-analytics==0.8.0
# homeassistant.components.homewizard
python-homewizard-energy==v6.3.0
python-homewizard-energy==v7.0.0
# homeassistant.components.hp_ilo
python-hpilo==4.4.3

View File

@ -1880,7 +1880,7 @@ python-fullykiosk==0.0.14
python-homeassistant-analytics==0.8.0
# homeassistant.components.homewizard
python-homewizard-energy==v6.3.0
python-homewizard-energy==v7.0.0
# homeassistant.components.izone
python-izone==1.2.9

View File

@ -4,7 +4,7 @@ from collections.abc import Generator
from unittest.mock import AsyncMock, MagicMock, patch
from homewizard_energy.errors import NotFoundError
from homewizard_energy.models import Data, Device, State, System
from homewizard_energy.v1.models import Data, Device, State, System
import pytest
from homeassistant.components.homewizard.const import DOMAIN
@ -27,11 +27,11 @@ def mock_homewizardenergy(
"""Return a mock bridge."""
with (
patch(
"homeassistant.components.homewizard.coordinator.HomeWizardEnergy",
"homeassistant.components.homewizard.coordinator.HomeWizardEnergyV1",
autospec=True,
) as homewizard,
patch(
"homeassistant.components.homewizard.config_flow.HomeWizardEnergy",
"homeassistant.components.homewizard.config_flow.HomeWizardEnergyV1",
new=homewizard,
),
):

View File

@ -3,7 +3,7 @@
from unittest.mock import MagicMock
from homewizard_energy.errors import RequestError
from homewizard_energy.models import Data
from homewizard_energy.v1.models import Data
import pytest
from syrupy.assertion import SnapshotAssertion