allow multiple heaters per incomfort gateway (#28324)
* add multiple heaters per gateway * bump client to handle the above
This commit is contained in:
parent
6d734a714e
commit
e1eab214ad
7 changed files with 19 additions and 17 deletions
|
@ -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(
|
||||
|
|
|
@ -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):
|
||||
|
|
|
@ -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):
|
||||
|
|
|
@ -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": [
|
||||
|
|
|
@ -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]
|
||||
)
|
||||
|
||||
|
||||
|
|
|
@ -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):
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue