Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix for error logging. #87

Merged
merged 1 commit into from
Jan 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions custom_components/daikin_altherma/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,8 @@ def water_tank_target_temp_config(self) -> dict:
if "DomesticHotWaterTemperatureHeating" in self.device.hot_water_tank._unit.operation_config:
return self.device.hot_water_tank._unit.operation_config["DomesticHotWaterTemperatureHeating"]

return self.device.hot_water_tank._unit.operation_config["TargetTemperature"][
"heating"
]
if "TargetTemperature" in self.device.hot_water_tank._unit.operation_config:
return self.device.hot_water_tank._unit.operation_config["TargetTemperature"][
"heating"
]
return {}
2 changes: 1 addition & 1 deletion custom_components/daikin_altherma/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"pyaltherma==0.0.21"
],
"ssdp": [],
"version": "1.3.11",
"version": "1.3.2",
"zeroconf": [
"_daikin._tcp.local."
]
Expand Down
2 changes: 0 additions & 2 deletions custom_components/daikin_altherma/sensor.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import logging
from homeassistant.components.sensor import SensorEntity, SensorDeviceClass, SensorStateClass
#DEVICE_CLASS_TEMPERATURE, STATE_CLASS_TOTAL_INCREASING
from homeassistant.const import UnitOfEnergy, UnitOfTemperature
# TEMP_CELSIUS, ENERGY_KILO_WATT_HOUR, DEVICE_CLASS_ENERGY
from homeassistant.helpers.typing import StateType
from homeassistant.helpers.update_coordinator import (
CoordinatorEntity,
Expand Down
27 changes: 19 additions & 8 deletions custom_components/daikin_altherma/water_heater.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,14 @@ async def async_set_operation_mode(self, operation_mode):

def _is_settable_target_temp(self):
device = self._api.device.hot_water_tank
if device is None:
return False

if device._unit is None:
return False
if 'DomesticHotWaterTemperatureHeating' not in device._unit.operation_config:
return False

conf = device._unit.operation_config['DomesticHotWaterTemperatureHeating']
if 'settable' in conf:
return conf['settable']
Expand All @@ -89,7 +97,7 @@ def supported_features(self):
states = status['states']
if 'WeatherDependentState' in states:
if states['WeatherDependentState']:
return SUPPORT_OPERATION_MODE
return WaterHeaterEntityFeature.OPERATION_MODE
return SUPPORT_FLAGS_HEATER

@property
Expand All @@ -104,7 +112,6 @@ def target_temperature(self) -> float:
@property
def current_temperature(self) -> float:
status = self._get_status()
#_LOGGER.warning(f"Hot Water status: {status}")
if "sensors" in status:
sensors = status["sensors"]
if "TankTemperature" in sensors:
Expand All @@ -116,22 +123,26 @@ def current_temperature(self) -> float:
if "SensorTemperature" in operations:
return operations["SensorTemperature"]
return 0
#current_temperature = status[
# "sensors"
#]["TankTemperature"]
#return current_temperature

@property
def current_operation(self):
return self._api.water_tank_operation

@property
def min_temp(self):
return self._api.water_tank_target_temp_config["minValue"]
if self._api.water_tank_target_temp_config is None:
return None
if 'minValue' in self._api.water_tank_target_temp_config:
return self._api.water_tank_target_temp_config["minValue"]
return None

@property
def max_temp(self):
return self._api.water_tank_target_temp_config["maxValue"]
if self._api.water_tank_target_temp_config is None:
return None
if 'maxValue' in self._api.water_tank_target_temp_config:
return self._api.water_tank_target_temp_config["maxValue"]
return None

async def async_update(self):
await self._api.async_update()
Expand Down