Skip to content

Commit

Permalink
Merge pull request #56 from marcoboers/52-round-the-long-decimals
Browse files Browse the repository at this point in the history
Add suggested_display_precision with sensible defaults to sensors
  • Loading branch information
marcoboers authored Dec 1, 2023
2 parents c630461 + dab2577 commit 7fd6b9e
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions custom_components/quatt/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,60 +97,69 @@
icon="mdi:thermometer",
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
device_class=SensorDeviceClass.TEMPERATURE,
suggested_display_precision=2,
),
SensorEntityDescription(
name="HP1 temperatureWaterIn",
key="hp1.temperatureWaterIn",
icon="mdi:thermometer",
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
device_class=SensorDeviceClass.TEMPERATURE,
suggested_display_precision=2,
),
SensorEntityDescription(
name="HP1 temperatureWaterOut",
key="hp1.temperatureWaterOut",
icon="mdi:thermometer",
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
device_class=SensorDeviceClass.TEMPERATURE,
suggested_display_precision=2,
),
SensorEntityDescription(
name="HP1 waterDelta",
key="hp1.computedWaterDelta",
icon="mdi:thermometer",
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
device_class=SensorDeviceClass.TEMPERATURE,
suggested_display_precision=2,
),
SensorEntityDescription(
name="HP1 heatPower",
key="hp1.computedHeatPower",
icon="mdi:heat-wave",
native_unit_of_measurement="W",
device_class=SensorDeviceClass.POWER,
suggested_display_precision=0,
),
SensorEntityDescription(
name="HP1 powerInput",
key="hp1.powerInput",
icon="mdi:heat-wave",
native_unit_of_measurement="W",
device_class=SensorDeviceClass.POWER,
suggested_display_precision=0,
),
SensorEntityDescription(
name="HP1 power",
key="hp1.power",
icon="mdi:heat-wave",
native_unit_of_measurement="W",
device_class=SensorDeviceClass.POWER,
suggested_display_precision=0,
),
SensorEntityDescription(
name="HP1 Quatt COP",
key="hp1.computedQuattCop",
icon="mdi:heat-pump",
native_unit_of_measurement="CoP",
suggested_display_precision=2,
),
SensorEntityDescription(
name="HP1 COP",
key="hp1.computedCop",
icon="mdi:heat-pump",
native_unit_of_measurement="CoP",
suggested_display_precision=2,
),
# Heatpump 2
SensorEntityDescription(
Expand All @@ -165,6 +174,7 @@
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
device_class=SensorDeviceClass.TEMPERATURE,
entity_registry_enabled_default=False,
suggested_display_precision=2,
),
SensorEntityDescription(
name="HP2 temperatureWaterIn",
Expand All @@ -173,6 +183,7 @@
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
device_class=SensorDeviceClass.TEMPERATURE,
entity_registry_enabled_default=False,
suggested_display_precision=2,
),
SensorEntityDescription(
name="HP2 temperatureWaterOut",
Expand All @@ -181,26 +192,30 @@
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
device_class=SensorDeviceClass.TEMPERATURE,
entity_registry_enabled_default=False,
suggested_display_precision=2,
),
SensorEntityDescription(
name="HP2 powerInput",
key="hp2.powerInput",
icon="mdi:heat-wave",
native_unit_of_measurement="W",
device_class=SensorDeviceClass.POWER,
suggested_display_precision=0,
),
SensorEntityDescription(
name="HP2 power",
key="hp2.power",
icon="mdi:heat-wave",
native_unit_of_measurement="W",
device_class=SensorDeviceClass.POWER,
suggested_display_precision=0,
),
SensorEntityDescription(
name="HP2 Quatt COP",
key="hp2.computedQuattCop",
icon="mdi:heat-pump",
native_unit_of_measurement="CoP",
suggested_display_precision=2,
),
# Boiler
SensorEntityDescription(
Expand All @@ -209,13 +224,15 @@
icon="mdi:thermometer",
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
device_class=SensorDeviceClass.TEMPERATURE,
suggested_display_precision=2,
),
SensorEntityDescription(
name="Boiler temperature water outlet",
key="boiler.otFbSupplyOutletTemperature",
icon="mdi:thermometer",
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
device_class=SensorDeviceClass.TEMPERATURE,
suggested_display_precision=2,
),
# Flowmeter
SensorEntityDescription(
Expand All @@ -224,12 +241,14 @@
icon="mdi:thermometer",
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
device_class=SensorDeviceClass.TEMPERATURE,
suggested_display_precision=2,
),
SensorEntityDescription(
name="FlowMeter flowRate",
key="flowMeter.flowRate",
icon="mdi:gauge",
native_unit_of_measurement="l/h",
suggested_display_precision=2,
),
# Thermostat
SensorEntityDescription(
Expand All @@ -238,20 +257,23 @@
icon="mdi:thermometer",
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
device_class=SensorDeviceClass.TEMPERATURE,
suggested_display_precision=2,
),
SensorEntityDescription(
name="Thermostat room setpoint",
key="thermostat.otFtRoomSetpoint",
icon="mdi:thermometer",
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
device_class=SensorDeviceClass.TEMPERATURE,
suggested_display_precision=1,
),
SensorEntityDescription(
name="Thermostat room temperature",
key="thermostat.otFtRoomTemperature",
icon="mdi:thermometer",
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
device_class=SensorDeviceClass.TEMPERATURE,
suggested_display_precision=2,
),
# QC
SensorEntityDescription(
Expand Down

0 comments on commit 7fd6b9e

Please sign in to comment.