Skip to content

Commit

Permalink
fix: bump library to 0.15.1
Browse files Browse the repository at this point in the history
  • Loading branch information
cryptk committed Jan 10, 2025
1 parent 1c0a352 commit d70be0b
Show file tree
Hide file tree
Showing 22 changed files with 72 additions and 107 deletions.
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"python.testing.pytestEnabled": false,
"[python]": {
"editor.defaultFormatter": "ms-python.black-formatter",
"editor.formatOnSave": true
"editor.formatOnSave": true,
}
}
12 changes: 3 additions & 9 deletions custom_components/omnilogic_local/__init__.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,15 @@
"""The OmniLogic Local integration."""

from __future__ import annotations

import logging
from typing import cast

from pyomnilogic_local.api import OmniLogicAPI
from pyomnilogic_local.types import OmniType
from pyomnilogic_local.omnitypes import OmniType

from homeassistant.config_entries import ConfigEntry
from homeassistant.const import (
CONF_IP_ADDRESS,
CONF_NAME,
CONF_PORT,
CONF_SCAN_INTERVAL,
CONF_TIMEOUT,
Platform,
)
from homeassistant.const import CONF_IP_ADDRESS, CONF_NAME, CONF_PORT, CONF_SCAN_INTERVAL, CONF_TIMEOUT, Platform
from homeassistant.core import HomeAssistant
from homeassistant.exceptions import ConfigEntryNotReady
from homeassistant.helpers import device_registry as dr
Expand Down
21 changes: 4 additions & 17 deletions custom_components/omnilogic_local/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,13 @@
from typing import TYPE_CHECKING, cast

from pyomnilogic_local.models.telemetry import TelemetryBoW
from pyomnilogic_local.types import (
BackyardState,
CSADType,
HeaterState,
OmniType,
SensorType,
)

from homeassistant.components.binary_sensor import (
BinarySensorDeviceClass,
BinarySensorEntity,
)
from pyomnilogic_local.omnitypes import BackyardState, CSADType, HeaterState, OmniType, SensorType

from homeassistant.components.binary_sensor import BinarySensorDeviceClass, BinarySensorEntity

from .const import BACKYARD_SYSTEM_ID, DOMAIN, KEY_COORDINATOR
from .entity import OmniLogicEntity
from .types.entity_index import (
EntityIndexBackyard,
EntityIndexHeaterEquip,
EntityIndexSensor,
)
from .types.entity_index import EntityIndexBackyard, EntityIndexHeaterEquip, EntityIndexSensor
from .utils import get_entities_of_hass_type, get_entities_of_omni_types

if TYPE_CHECKING:
Expand Down
8 changes: 1 addition & 7 deletions custom_components/omnilogic_local/button.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,7 @@
import logging
from typing import TYPE_CHECKING, Final, Literal, TypeVar

from pyomnilogic_local.types import (
FilterState,
FilterType,
OmniType,
PumpState,
PumpType,
)
from pyomnilogic_local.omnitypes import FilterState, FilterType, OmniType, PumpState, PumpType

from homeassistant.components.button import ButtonEntity

Expand Down
9 changes: 2 additions & 7 deletions custom_components/omnilogic_local/config_flow.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Config flow for OmniLogic Local integration."""

from __future__ import annotations

import logging
Expand All @@ -8,13 +9,7 @@
import voluptuous as vol

from homeassistant import config_entries
from homeassistant.const import (
CONF_IP_ADDRESS,
CONF_NAME,
CONF_PORT,
CONF_SCAN_INTERVAL,
CONF_TIMEOUT,
)
from homeassistant.const import CONF_IP_ADDRESS, CONF_NAME, CONF_PORT, CONF_SCAN_INTERVAL, CONF_TIMEOUT
from homeassistant.core import HomeAssistant, callback
from homeassistant.data_entry_flow import FlowResult
from homeassistant.exceptions import HomeAssistantError
Expand Down
3 changes: 2 additions & 1 deletion custom_components/omnilogic_local/const.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
"""Constants for the OmniLogic Local integration."""

from typing import Final

from pyomnilogic_local.types import OmniType
from pyomnilogic_local.omnitypes import OmniType

# from homeassistant.backports.enum import StrEnum

Expand Down
4 changes: 3 additions & 1 deletion custom_components/omnilogic_local/coordinator.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
if SIMULATION:
import json

from .test_diagnostic_data import TEST_DIAGNOSTIC_DATA
# This line is only used during development when simulating a pool with diagnostic data
# Disable the pylint and mypy alerts that don't like it when this variable isn't defined
from .test_diagnostic_data import TEST_DIAGNOSTIC_DATA # type: ignore # pylint: disable=no-name-in-module

_LOGGER = logging.getLogger(__name__)

Expand Down
1 change: 1 addition & 0 deletions custom_components/omnilogic_local/diagnostics.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Diagnostics support for ESPHome."""

from __future__ import annotations

from typing import Any
Expand Down
2 changes: 1 addition & 1 deletion custom_components/omnilogic_local/entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from pyomnilogic_local.models.mspconfig import MSPSystem
from pyomnilogic_local.models.telemetry import TelemetryBackyard, TelemetryType
from pyomnilogic_local.types import BackyardState, OmniType
from pyomnilogic_local.omnitypes import BackyardState, OmniType

from homeassistant.core import callback
from homeassistant.helpers.entity import DeviceInfo
Expand Down
1 change: 1 addition & 0 deletions custom_components/omnilogic_local/errors.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Custom error types for the omnilogic integration."""

from __future__ import annotations

from homeassistant.exceptions import HomeAssistantError
Expand Down
17 changes: 3 additions & 14 deletions custom_components/omnilogic_local/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,9 @@
import logging
from typing import TYPE_CHECKING, Any

from pyomnilogic_local.types import (
ColorLogicBrightness,
ColorLogicLightType,
ColorLogicPowerState,
ColorLogicShow,
)

from homeassistant.components.light import (
ATTR_BRIGHTNESS,
ATTR_EFFECT,
ColorMode,
LightEntity,
LightEntityFeature,
)
from pyomnilogic_local.omnitypes import ColorLogicBrightness, ColorLogicLightType, ColorLogicPowerState, ColorLogicShow

from homeassistant.components.light import ATTR_BRIGHTNESS, ATTR_EFFECT, ColorMode, LightEntity, LightEntityFeature
from homeassistant.exceptions import HomeAssistantError

from .types.entity_index import EntityIndexColorLogicLight
Expand Down
4 changes: 2 additions & 2 deletions custom_components/omnilogic_local/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
"issue_tracker": "https://github.com/cryptk/haomnilogic-local/issues",
"loggers": ["pyomnilogic_local"],
"requirements": [
"python_omnilogic_local==0.14.6"
"python_omnilogic_local==0.15.1"
],
"ssdp": [],
"version": "0.7.8",
"version": "0.7.10",
"zeroconf": []
}
10 changes: 2 additions & 8 deletions custom_components/omnilogic_local/number.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from math import floor
from typing import TYPE_CHECKING, Any, TypeVar, cast

from pyomnilogic_local.types import (
from pyomnilogic_local.omnitypes import (
BodyOfWaterType,
ChlorinatorDispenserType,
ChlorinatorOperatingMode,
Expand All @@ -21,13 +21,7 @@

from .const import DOMAIN, KEY_COORDINATOR
from .entity import OmniLogicEntity
from .types.entity_index import (
EntityIndexBodyOfWater,
EntityIndexChlorinator,
EntityIndexFilter,
EntityIndexHeater,
EntityIndexPump,
)
from .types.entity_index import EntityIndexBodyOfWater, EntityIndexChlorinator, EntityIndexFilter, EntityIndexHeater, EntityIndexPump
from .utils import get_entities_of_hass_type, get_entities_of_omni_types

if TYPE_CHECKING:
Expand Down
22 changes: 3 additions & 19 deletions custom_components/omnilogic_local/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,10 @@
import logging
from typing import TYPE_CHECKING, Any, Generic, Literal, TypeVar, cast

from pyomnilogic_local.types import (
ChlorinatorDispenserType,
CSADType,
FilterState,
HeaterType,
OmniType,
SensorType,
SensorUnits,
)
from pyomnilogic_local.omnitypes import ChlorinatorDispenserType, CSADType, FilterState, HeaterType, OmniType, SensorType, SensorUnits

from homeassistant.components.sensor import (
SensorDeviceClass,
SensorEntity,
SensorStateClass,
)
from homeassistant.const import (
CONCENTRATION_PARTS_PER_MILLION,
UnitOfPower,
UnitOfTemperature,
)
from homeassistant.components.sensor import SensorDeviceClass, SensorEntity, SensorStateClass
from homeassistant.const import CONCENTRATION_PARTS_PER_MILLION, UnitOfPower, UnitOfTemperature
from homeassistant.helpers.typing import StateType

from .const import BACKYARD_SYSTEM_ID, DOMAIN, KEY_COORDINATOR
Expand Down
2 changes: 1 addition & 1 deletion custom_components/omnilogic_local/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from typing import TYPE_CHECKING, Any, TypeVar, cast

from pyomnilogic_local.models.telemetry import TelemetryFilter
from pyomnilogic_local.types import (
from pyomnilogic_local.omnitypes import (
BodyOfWaterType,
FilterState,
FilterValvePosition,
Expand Down
1 change: 1 addition & 0 deletions custom_components/omnilogic_local/tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Common fixtures for the OmniLogic Local tests."""

from collections.abc import Generator
from unittest.mock import AsyncMock, patch

Expand Down
6 changes: 2 additions & 4 deletions custom_components/omnilogic_local/tests/test_config_flow.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
"""Test the OmniLogic Local config flow."""

from unittest.mock import AsyncMock, patch

import pytest

from homeassistant import config_entries
from homeassistant.components.omnilogic_local.config_flow import (
CannotConnect,
InvalidAuth,
)
from homeassistant.components.omnilogic_local.config_flow import CannotConnect, InvalidAuth
from homeassistant.components.omnilogic_local.const import DOMAIN
from homeassistant.core import HomeAssistant
from homeassistant.data_entry_flow import FlowResultType
Expand Down
30 changes: 28 additions & 2 deletions custom_components/omnilogic_local/types/entity_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,34 @@

@dataclass
class EntityIndexData:
msp_config: MSPSchedule | MSPBackyard | MSPBoW | MSPVirtualHeater | MSPHeaterEquip | MSPRelay | MSPFilter | MSPSensor | MSPColorLogicLight | MSPChlorinator | MSPChlorinatorEquip | MSPCSAD
telemetry: TelemetryBackyard | TelemetryBoW | TelemetryChlorinator | TelemetryColorLogicLight | TelemetryFilter | TelemetryGroup | TelemetryHeater | TelemetryPump | TelemetryRelay | TelemetryValveActuator | TelemetryVirtualHeater | TelemetryCSAD
msp_config: (
MSPSchedule
| MSPBackyard
| MSPBoW
| MSPVirtualHeater
| MSPHeaterEquip
| MSPRelay
| MSPFilter
| MSPSensor
| MSPColorLogicLight
| MSPChlorinator
| MSPChlorinatorEquip
| MSPCSAD
)
telemetry: (
TelemetryBackyard
| TelemetryBoW
| TelemetryChlorinator
| TelemetryColorLogicLight
| TelemetryFilter
| TelemetryGroup
| TelemetryHeater
| TelemetryPump
| TelemetryRelay
| TelemetryValveActuator
| TelemetryVirtualHeater
| TelemetryCSAD
)


EntityIndexT = dict[int, EntityIndexData]
Expand Down
2 changes: 1 addition & 1 deletion custom_components/omnilogic_local/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import logging

from pyomnilogic_local.types import OmniType
from pyomnilogic_local.omnitypes import OmniType

from .const import OMNI_TO_HASS_TYPES
from .types.entity_index import EntityIndexT
Expand Down
7 changes: 2 additions & 5 deletions custom_components/omnilogic_local/water_heater.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,9 @@
from typing import TYPE_CHECKING, Any, Literal, cast

from pyomnilogic_local.models.telemetry import TelemetryBoW
from pyomnilogic_local.types import OmniType
from pyomnilogic_local.omnitypes import OmniType

from homeassistant.components.water_heater import (
WaterHeaterEntity,
WaterHeaterEntityFeature,
)
from homeassistant.components.water_heater import WaterHeaterEntity, WaterHeaterEntityFeature
from homeassistant.const import ATTR_TEMPERATURE, STATE_OFF, STATE_ON, UnitOfTemperature

from .const import DOMAIN, KEY_COORDINATOR
Expand Down
10 changes: 5 additions & 5 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "haomnilogic-local"
version = "0.7.8"
version = "0.7.10"
description = "A Home Assistant integration for Hayward OmniLogic/OmniHub pool controllers using the local UDP api"
readme = "README.md"
authors = [
Expand All @@ -21,7 +21,7 @@ package-mode = false
pre-commit = "^3.0.0"
mypy = "^1.2.0"
homeassistant = "^2024.6.0"
python_omnilogic_local = "0.14.6"
python_omnilogic_local = "0.15.1"
pylint = "^2.17.0"
pydantic = "^1.10.7"
pytest = "^7.3.1"
Expand All @@ -37,6 +37,7 @@ exclude-file="poetry.lock"
[tool.isort]
# https://github.com/PyCQA/isort/wiki/isort-Settings
profile = "black"
line_length = 140
# will group `import x` and `from x import` of the same module.
force_sort_within_sections = true
known_first_party = [
Expand Down

0 comments on commit d70be0b

Please sign in to comment.