allow multiple heaters per incomfort gateway (#28324)

* add multiple heaters per gateway
* bump client to handle the above
This commit is contained in:
David Bonnes 2019-10-29 21:29:39 +00:00 committed by GitHub
parent 6d734a714e
commit e1eab214ad
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 19 additions and 17 deletions

View file

@ -44,12 +44,13 @@ async def async_setup(hass, hass_config):
)
try:
heater = incomfort_data["heater"] = list(await client.heaters)[0]
heaters = incomfort_data["heaters"] = list(await client.heaters)
except ClientResponseError as err:
_LOGGER.warning("Setup failed, check your configuration, message is: %s", err)
return False
await heater.update()
for heater in heaters:
await heater.update()
for platform in ["water_heater", "binary_sensor", "sensor", "climate"]:
hass.async_create_task(

View file

@ -11,9 +11,10 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
if discovery_info is None:
return
async_add_entities(
[IncomfortFailed(hass.data[DOMAIN]["client"], hass.data[DOMAIN]["heater"])]
)
client = hass.data[DOMAIN]["client"]
heaters = hass.data[DOMAIN]["heaters"]
async_add_entities([IncomfortFailed(client, h) for h in heaters])
class IncomfortFailed(IncomfortChild, BinarySensorDevice):

View file

@ -17,9 +17,11 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
return
client = hass.data[DOMAIN]["client"]
heater = hass.data[DOMAIN]["heater"]
heaters = hass.data[DOMAIN]["heaters"]
async_add_entities([InComfortClimate(client, heater, r) for r in heater.rooms])
async_add_entities(
[InComfortClimate(client, h, r) for h in heaters for r in h.rooms]
)
class InComfortClimate(IncomfortChild, ClimateDevice):

View file

@ -3,7 +3,7 @@
"name": "Intergas InComfort/Intouch Lan2RF gateway",
"documentation": "https://www.home-assistant.io/integrations/incomfort",
"requirements": [
"incomfort-client==0.3.5"
"incomfort-client==0.4.0"
],
"dependencies": [],
"codeowners": [

View file

@ -29,14 +29,12 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
return
client = hass.data[DOMAIN]["client"]
heater = hass.data[DOMAIN]["heater"]
heaters = hass.data[DOMAIN]["heaters"]
async_add_entities(
[
IncomfortPressure(client, heater, INCOMFORT_PRESSURE),
IncomfortTemperature(client, heater, INCOMFORT_HEATER_TEMP),
IncomfortTemperature(client, heater, INCOMFORT_TAP_TEMP),
]
[IncomfortPressure(client, h, INCOMFORT_PRESSURE) for h in heaters]
+ [IncomfortTemperature(client, h, INCOMFORT_HEATER_TEMP) for h in heaters]
+ [IncomfortTemperature(client, h, INCOMFORT_TAP_TEMP) for h in heaters]
)

View file

@ -22,9 +22,9 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
return
client = hass.data[DOMAIN]["client"]
heater = hass.data[DOMAIN]["heater"]
heaters = hass.data[DOMAIN]["heaters"]
async_add_entities([IncomfortWaterHeater(client, heater)])
async_add_entities([IncomfortWaterHeater(client, h) for h in heaters])
class IncomfortWaterHeater(IncomfortEntity, WaterHeaterDevice):

View file

@ -694,7 +694,7 @@ iglo==1.2.7
ihcsdk==2.3.0
# homeassistant.components.incomfort
incomfort-client==0.3.5
incomfort-client==0.4.0
# homeassistant.components.influxdb
influxdb==5.2.3