Skip to content
This repository has been archived by the owner on Mar 25, 2024. It is now read-only.

Commit

Permalink
Cleanup energy code
Browse files Browse the repository at this point in the history
    * custom_components/daikin_residential_altherma/NOTELONTRA.txt:
    * custom_components/daikin_residential_altherma/const.py:
    * custom_components/daikin_residential_altherma/daikin_base.py:
    * custom_components/daikin_residential_altherma/sensor.py:
  • Loading branch information
jwillemsen committed Dec 8, 2023
1 parent 1bdbcb9 commit f9b3d51
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 29 deletions.
6 changes: 3 additions & 3 deletions custom_components/daikin_residential_altherma/NOTELONTRA.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
* * * * * * INSERIMENTO DI UN NUOVO SENSORE * * * * * *


1) const.py: Aggiungere una costante ATTR battezzandone il
1) const.py: Aggiungere una costante ATTR battezzandone il
nuovo nome, es:

ATTR_TANK_TEMPERATURE = "tankTemperature"


2) const.py: Aggiungere il CMD_SET con il percorso MP,DP e
2) const.py: Aggiungere il CMD_SET con il percorso MP,DP e
Value:

DAIKIN_CMD_SETS = {
Expand Down Expand Up @@ -145,4 +145,4 @@

@property
def state_class(self):
return STATE_CLASS_MEASUREMENT
return STATE_CLASS_MEASUREMENT
4 changes: 0 additions & 4 deletions custom_components/daikin_residential_altherma/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@
ATTR_ROOM_TEMPERATURE = "roomTemperature"
ATTR_LEAVINGWATER_OFFSET = "leavingWaterOffset"
ATTR_TANK_TEMPERATURE = "tankTemperature"
ATTR_ENERGY_CONSUMPTION = "energy_consumption"
ATTR_ENERGY_CONSUMPTION_TANK = "energy_consumption_tank"
ATTR_COOL_ENERGY = "cool_energy"
ATTR_HEAT_ENERGY = "heat_energy"
ATTR_HEAT_TANK_ENERGY = "heat_tank_energy"
Expand Down Expand Up @@ -122,8 +120,6 @@
MP_CLIMATE,
DP_TEMPERATURE,
"/operationModes/%operationMode%/setpoints/roomTemperature"],
ATTR_ENERGY_CONSUMPTION: [MP_CLIMATE, DP_CONSUMPTION, "/electrical"],
ATTR_ENERGY_CONSUMPTION_TANK: [MP_DOMESTIC_HWT, DP_CONSUMPTION, "/electrical"],
ATTR_SETPOINT_MODE: [MP_CLIMATE, "setpointMode", ""],
ATTR_CONTROL_MODE: [MP_CLIMATE, DP_CONTROL_MODE, ""],
ATTR_TANK_SETPOINT_MODE: [MP_DOMESTIC_HWT, "@TanksetpointMode", ""],
Expand Down
17 changes: 0 additions & 17 deletions custom_components/daikin_residential_altherma/daikin_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
ATTR_ON_OFF_CLIMATE,
ATTR_ON_OFF_TANK,
ATTR_OPERATION_MODE,
ATTR_ENERGY_CONSUMPTION,
ATTR_ENERGY_CONSUMPTION_TANK,
SENSOR_PERIOD_WEEKLY,
)

Expand Down Expand Up @@ -219,21 +217,6 @@ async def async_set_temperature(self, value):

return None

def energy_consumption(self, attribute, mode, period):
#DAMIANO
#def energy_consumption_domestic(self, mode, period):
"""Return the last hour heat power consumption of a given mode in kWh."""
energy_data = [
0 if v is None else v

#damiano
#for v in self.getData(ATTR_ENERGY_CONSUMPTION)[mode][period]
# passo anche mode e period
for v in self.getDataEC(attribute,mode,period)
]
start_index = 7 if period == SENSOR_PERIOD_WEEKLY else 12
return sum(energy_data[start_index:])

async def set(self, settings):
"""Set settings on Daikin device."""
raise NotImplementedError
Expand Down
5 changes: 0 additions & 5 deletions custom_components/daikin_residential_altherma/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@
from .const import (
DOMAIN as DAIKIN_DOMAIN,
DAIKIN_DEVICES,
ATTR_COOL_ENERGY,
ATTR_HEAT_ENERGY,
ATTR_HEAT_TANK_ENERGY,
ATTR_LEAVINGWATER_TEMPERATURE,
ATTR_LEAVINGWATER_OFFSET,
ATTR_OUTSIDE_TEMPERATURE,
Expand All @@ -42,7 +39,6 @@
ATTR_IS_IN_INSTALLER_STATE,
ATTR_IS_IN_WARNING_STATE,
ATTR_ERROR_CODE,
ATTR_ENERGY_CONSUMPTION,
#TANK
ATTR_TANK_OPERATION_MODE,
ATTR_TANK_HEATUP_MODE,
Expand All @@ -53,7 +49,6 @@
ATTR_TANK_IS_IN_WARNING_STATE,
ATTR_TANK_IS_POWERFUL_MODE_ACTIVE,
ATTR_TANK_ERROR_CODE,
ATTR_ENERGY_CONSUMPTION_TANK,
SENSOR_TYPE_ENERGY,
SENSOR_TYPE_POWER,
SENSOR_TYPE_TEMPERATURE,
Expand Down

0 comments on commit f9b3d51

Please sign in to comment.