[go: nahoru, domu]

Skip to content

Commit

Permalink
Bump version to 1.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
qqaatw committed Jun 16, 2023
1 parent edebf28 commit c0fb36b
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 38 deletions.
23 changes: 3 additions & 20 deletions custom_components/jcihitachi_tw/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
from dataclasses import dataclass, field
from datetime import timedelta
from queue import Queue
from typing import TYPE_CHECKING, Optional
from typing import Optional

import async_timeout
from homeassistant.helpers import discovery
from homeassistant.helpers.update_coordinator import (CoordinatorEntity,
DataUpdateCoordinator,
UpdateFailed)
from homeassistant.requirements import RequirementsNotFound
from homeassistant.util.package import install_package, is_installed
from JciHitachi import __version__
from JciHitachi.api import JciHitachiAWSAPI

from .const import (API, CONF_DEVICES, CONF_EMAIL, CONF_PASSWORD, CONF_RETRY,
CONFIG_SCHEMA, COORDINATOR, DOMAIN, UPDATE_DATA,
Expand All @@ -23,15 +23,6 @@
DATA_UPDATE_INTERVAL = timedelta(seconds=30)
BASE_TIMEOUT = 5

if TYPE_CHECKING:
from JciHitachi.api import JciHitachiAWSAPI

def _lazy_install():
custom_required_packages = ["LibJciHitachi==1.2.2"]
links = "https://qqaatw.github.io/aws-crt-python-musllinux/"
for pkg in custom_required_packages:
if not is_installed(pkg) and not install_package(pkg, find_links=links):
raise RequirementsNotFound(DOMAIN, [pkg])

def build_coordinator(hass, api):

Expand Down Expand Up @@ -92,10 +83,6 @@ async def async_setup(hass, config):
if config[DOMAIN].get(CONF_DEVICES) == []:
config[DOMAIN][CONF_DEVICES] = None

_lazy_install()
from JciHitachi import __version__
from JciHitachi.api import JciHitachiAWSAPI

api = JciHitachiAWSAPI(
email=config[DOMAIN].get(CONF_EMAIL),
password=config[DOMAIN].get(CONF_PASSWORD),
Expand Down Expand Up @@ -145,10 +132,6 @@ async def async_setup_entry(hass, config_entry):
if config.get(CONF_DEVICES) == []:
config[CONF_DEVICES] = None

_lazy_install()
from JciHitachi import __version__
from JciHitachi.api import JciHitachiAWSAPI

api = JciHitachiAWSAPI(
email=config.get(CONF_EMAIL),
password=config.get(CONF_PASSWORD),
Expand Down
3 changes: 2 additions & 1 deletion custom_components/jcihitachi_tw/binary_sensor.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
"""JciHitachi integration."""
import logging

from homeassistant.components.binary_sensor import (BinarySensorEntity, BinarySensorDeviceClass)
from homeassistant.components.binary_sensor import (BinarySensorDeviceClass,
BinarySensorEntity)

from . import API, COORDINATOR, DOMAIN, UPDATED_DATA, JciHitachiEntity

Expand Down
9 changes: 1 addition & 8 deletions custom_components/jcihitachi_tw/config_flow.py
Original file line number Diff line number Diff line change
@@ -1,25 +1,18 @@
"""JciHitachi integration."""
import logging
from typing import TYPE_CHECKING

from homeassistant import config_entries
from homeassistant.const import CONF_DEVICES, CONF_EMAIL, CONF_PASSWORD
from JciHitachi.api import JciHitachiAWSAPI

from . import _lazy_install
from .const import (CONF_ADD_ANOTHER_DEVICE, CONF_RETRY,
CONFIG_FLOW_ADD_DEVICE_SCHEMA, CONFIG_FLOW_SCHEMA, DOMAIN)

_LOGGER = logging.getLogger(__name__)

if TYPE_CHECKING:
from JciHitachi.api import JciHitachiAWSAPI

async def validate_auth(hass, email, password, device_names, max_retries) -> None:
"""Validates JciHitachiAWS account and devices."""

_lazy_install()
from JciHitachi.api import JciHitachiAWSAPI

api = JciHitachiAWSAPI(
email=email,
password=password,
Expand Down
4 changes: 3 additions & 1 deletion custom_components/jcihitachi_tw/humidifier.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
"""JciHitachi integration."""
import logging

from homeassistant.components.humidifier import HumidifierEntity, HumidifierDeviceClass, SUPPORT_MODES
from homeassistant.components.humidifier import (SUPPORT_MODES,
HumidifierDeviceClass,
HumidifierEntity)

from . import API, COORDINATOR, DOMAIN, UPDATED_DATA, JciHitachiEntity

Expand Down
4 changes: 2 additions & 2 deletions custom_components/jcihitachi_tw/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
"documentation": "https://github.com/qqaatw/JciHitachiHA",
"iot_class": "cloud_polling",
"issue_tracker": "https://github.com/qqaatw/JciHitachiHA/issues",
"requirements": [],
"version": "1.3.1"
"requirements": ["LibJciHitachi==1.3.0"],
"version": "1.4.0"
}
10 changes: 4 additions & 6 deletions custom_components/jcihitachi_tw/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@
import datetime
import logging

from homeassistant.components.sensor import (STATE_CLASS_MEASUREMENT,
STATE_CLASS_TOTAL_INCREASING,
SensorDeviceClass,
SensorEntity)
from homeassistant.const import (CONCENTRATION_MICROGRAMS_PER_CUBIC_METER, PERCENTAGE,
UnitOfEnergy, UnitOfTemperature)
from homeassistant.components.sensor import (STATE_CLASS_TOTAL_INCREASING,
SensorDeviceClass, SensorEntity)
from homeassistant.const import (CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
PERCENTAGE, UnitOfEnergy, UnitOfTemperature)

from . import API, COORDINATOR, DOMAIN, UPDATED_DATA, JciHitachiEntity

Expand Down

0 comments on commit c0fb36b

Please sign in to comment.