Skip to content

Commit

Permalink
Jiahong ET72W: energy sensor is actually runtime
Browse files Browse the repository at this point in the history
Comment on PR #181
  • Loading branch information
make-all committed Dec 12, 2024
1 parent 9dda00e commit 7e9c20d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,14 +139,12 @@ secondary_entities:
- dps_val: true
value: F
- entity: sensor
name: Energy
name: Runtime
dps:
- id: 117
type: integer
name: sensor
unit: kWh
mapping:
- scale: 10
unit: min
- id: 116
type: integer
name: calibration
Expand Down
14 changes: 7 additions & 7 deletions tests/devices/test_jiahong_et72w_thermostat.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from homeassistant.components.climate.const import ClimateEntityFeature, HVACMode
from homeassistant.components.number.const import NumberDeviceClass
from homeassistant.components.sensor import STATE_CLASS_MEASUREMENT, SensorDeviceClass
from homeassistant.const import UnitOfEnergy, UnitOfTemperature
from homeassistant.const import UnitOfTemperature, UnitOfTime

from ..const import JIAHONG_ET72W_PAYLOAD
from ..mixins.climate import TargetTemperatureTests
Expand All @@ -25,7 +25,7 @@
UNKNOWN112_DPS = "112"
UNKNOWN113_DPS = "113"
CALIB_DPS = "116"
ENERGY_DPS = "117"
RUNTIME_DPS = "117"
HVACACTION_DPS = "118"
TEMPLIMIT_DPS = "121"

Expand Down Expand Up @@ -115,10 +115,10 @@ def setUp(self):
"testdata": (214, 21.4),
},
{
"dps": ENERGY_DPS,
"name": "sensor_energy",
"unit": UnitOfEnergy.KILO_WATT_HOUR,
"testdata": (1234, 123.4),
"dps": RUNTIME_DPS,
"name": "sensor_runtime",
"unit": UnitOfTime.MINUTES,
"testdata": (1234, 1234),
},
]
)
Expand Down Expand Up @@ -228,7 +228,7 @@ def test_extra_state_attributes(self):
def test_multi_sensor_extra_state_attributes(self):
self.dps[CALIB_DPS] = 321
self.assertEqual(
self.multiSensor["sensor_energy"].extra_state_attributes,
self.multiSensor["sensor_runtime"].extra_state_attributes,
{"calibration": 321},
)

Expand Down

0 comments on commit 7e9c20d

Please sign in to comment.