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: try:
heater = incomfort_data["heater"] = list(await client.heaters)[0] heaters = incomfort_data["heaters"] = list(await client.heaters)
except ClientResponseError as err: except ClientResponseError as err:
_LOGGER.warning("Setup failed, check your configuration, message is: %s", err) _LOGGER.warning("Setup failed, check your configuration, message is: %s", err)
return False return False
await heater.update() for heater in heaters:
await heater.update()
for platform in ["water_heater", "binary_sensor", "sensor", "climate"]: for platform in ["water_heater", "binary_sensor", "sensor", "climate"]:
hass.async_create_task( 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: if discovery_info is None:
return return
async_add_entities( client = hass.data[DOMAIN]["client"]
[IncomfortFailed(hass.data[DOMAIN]["client"], hass.data[DOMAIN]["heater"])] heaters = hass.data[DOMAIN]["heaters"]
)
async_add_entities([IncomfortFailed(client, h) for h in heaters])
class IncomfortFailed(IncomfortChild, BinarySensorDevice): class IncomfortFailed(IncomfortChild, BinarySensorDevice):

View File

@ -17,9 +17,11 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
return return
client = hass.data[DOMAIN]["client"] 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): class InComfortClimate(IncomfortChild, ClimateDevice):

View File

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

View File

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

View File

@ -22,9 +22,9 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
return return
client = hass.data[DOMAIN]["client"] 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): class IncomfortWaterHeater(IncomfortEntity, WaterHeaterDevice):

View File

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