Bump version bsblan library to 0.4.0 (#42220)

This commit is contained in:
Willem-Jan 2020-10-23 14:32:47 +02:00 committed by GitHub
parent 20c43df768
commit 1340abb2fe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 16 additions and 20 deletions

View file

@ -28,7 +28,6 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
bsblan = BSBLan(
entry.data[CONF_HOST],
passkey=entry.data[CONF_PASSKEY],
loop=hass.loop,
port=entry.data[CONF_PORT],
session=session,
)

View file

@ -94,14 +94,13 @@ class BSBLanClimate(ClimateEntity):
"""Initialize BSBLan climate device."""
self._current_temperature: Optional[float] = None
self._available = True
self._current_hvac_mode: Optional[int] = None
self._hvac_mode: Optional[str] = None
self._target_temperature: Optional[float] = None
self._info: Info = info
self.bsblan = bsblan
self._temperature_unit = None
self._hvac_mode = None
self._preset_mode = None
self._store_hvac_mode = None
self._info: Info = info
self.bsblan = bsblan
@property
def name(self) -> str:
@ -138,7 +137,7 @@ class BSBLanClimate(ClimateEntity):
@property
def hvac_mode(self):
"""Return the current operation mode."""
return self._current_hvac_mode
return self._hvac_mode
@property
def hvac_modes(self):
@ -165,10 +164,10 @@ class BSBLanClimate(ClimateEntity):
_LOGGER.debug("Setting preset mode to: %s", preset_mode)
if preset_mode == PRESET_NONE:
# restore previous hvac mode
self._current_hvac_mode = self._store_hvac_mode
self._hvac_mode = self._store_hvac_mode
else:
# Store hvac mode.
self._store_hvac_mode = self._current_hvac_mode
self._store_hvac_mode = self._hvac_mode
await self.async_set_data(preset_mode=preset_mode)
async def async_set_hvac_mode(self, hvac_mode):
@ -216,18 +215,18 @@ class BSBLanClimate(ClimateEntity):
self._available = True
self._current_temperature = float(state.current_temperature)
self._target_temperature = float(state.target_temperature)
self._current_temperature = float(state.current_temperature.value)
self._target_temperature = float(state.target_temperature.value)
# check if preset is active else get hvac mode
_LOGGER.debug("state hvac/preset mode: %s", state.current_hvac_mode)
if state.current_hvac_mode == "2":
_LOGGER.debug("state hvac/preset mode: %s", state.hvac_mode.value)
if state.hvac_mode.value == "2":
self._preset_mode = PRESET_ECO
else:
self._current_hvac_mode = BSBLAN_TO_HA_STATE[state.current_hvac_mode]
self._hvac_mode = BSBLAN_TO_HA_STATE[state.hvac_mode.value]
self._preset_mode = PRESET_NONE
self._temperature_unit = state.temperature_unit
self._temperature_unit = state.current_temperature.unit
@property
def device_info(self) -> Dict[str, Any]:

View file

@ -75,7 +75,5 @@ class BSBLanFlowHandler(ConfigFlow, domain=DOMAIN):
"""Get device information from an BSBLan device."""
session = async_get_clientsession(self.hass)
_LOGGER.debug("request bsblan.info:")
bsblan = BSBLan(
host, passkey=passkey, port=port, session=session, loop=self.hass.loop
)
bsblan = BSBLan(host, passkey=passkey, port=port, session=session)
return await bsblan.info()

View file

@ -3,6 +3,6 @@
"name": "BSB-Lan",
"config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/bsblan",
"requirements": ["bsblan==0.3.7"],
"requirements": ["bsblan==0.4.0"],
"codeowners": ["@liudger"]
}

View file

@ -392,7 +392,7 @@ brottsplatskartan==0.0.1
brunt==0.1.3
# homeassistant.components.bsblan
bsblan==0.3.7
bsblan==0.4.0
# homeassistant.components.bluetooth_tracker
bt_proximity==0.2

View file

@ -210,7 +210,7 @@ broadlink==0.15.0
brother==0.1.18
# homeassistant.components.bsblan
bsblan==0.3.7
bsblan==0.4.0
# homeassistant.components.buienradar
buienradar==1.0.4