Skip to content

Commit

Permalink
Add missing Airconwithme to Config Flow
Browse files Browse the repository at this point in the history
  • Loading branch information
jnimmo committed Sep 4, 2022
1 parent f6e4891 commit f7b0076
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
18 changes: 9 additions & 9 deletions custom_components/intesishome/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
DEVICE_INTESISHOME,
DEVICE_INTESISHOME_LOCAL,
)
import voluptuous as vol

from homeassistant import config_entries, core
from homeassistant.components.climate import ClimateEntity
Expand All @@ -45,13 +44,10 @@
CONF_USERNAME,
TEMP_CELSIUS,
)
from homeassistant.core import HomeAssistant
from homeassistant.exceptions import PlatformNotReady
from homeassistant.helpers.aiohttp_client import async_get_clientsession
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.event import async_call_later
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType

from . import DOMAIN

Expand Down Expand Up @@ -104,8 +100,8 @@ class SwingSettings(NamedTuple):
async def async_setup_entry(
hass: core.HomeAssistant,
config_entry: config_entries.ConfigEntry,
async_add_entities,
):
async_add_entities: AddEntitiesCallback,
) -> None:
"""Create climate entities from config flow."""
config = config_entry.data
if "controller" in hass.data[DOMAIN]:
Expand Down Expand Up @@ -191,7 +187,7 @@ def __init__(self, ih_device_id, ih_device, controller):
self._min_temp: int = None
self._target_temp: float = None
self._outdoor_temp: float = None
self._hvac_mode: str = None
self._hvac_mode: HVACMode = None
self._preset: str = None
self._preset_list: list[str] = [PRESET_ECO, PRESET_COMFORT, PRESET_BOOST]
self._run_hours: int = None
Expand Down Expand Up @@ -421,7 +417,11 @@ async def async_update_callback(self, device_id=None):
# Connection has dropped
self._connected = False
reconnect_seconds = 30
if self._device_type in [DEVICE_INTESISHOME, DEVICE_AIRCONWITHME]:
if self._device_type in [
DEVICE_INTESISHOME,
DEVICE_ANYWAIR,
DEVICE_AIRCONWITHME,
]:
# Add a random delay for cloud connections
reconnect_seconds = randrange(30, 600)

Expand Down Expand Up @@ -459,7 +459,7 @@ def max_temp(self):
@property
def should_poll(self):
"""Poll for updates if pyIntesisHome doesn't have a socket open."""
return False
return True

@property
def fan_mode(self):
Expand Down
1 change: 1 addition & 0 deletions custom_components/intesishome/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ async def async_step_details(self, user_input=None):
password=user_input[CONF_PASSWORD],
loop=self.hass.loop,
websession=async_get_clientsession(self.hass),
device_type=device_type,
)

# Try to attempt a connection
Expand Down
2 changes: 1 addition & 1 deletion custom_components/intesishome/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
"iot_class": "cloud_push",
"loggers": ["pyintesishome"],
"config_flow": true,
"version": "1.0.2"
"version": "1.0.3"
}

0 comments on commit f7b0076

Please sign in to comment.