Skip to content

Commit 83e61bd

Browse files
authored
feat: Add icons for gas, water and energy (#90)
1 parent dce29f2 commit 83e61bd

File tree

11 files changed

+19
-1
lines changed

11 files changed

+19
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ switch | Only turning on/off, energy consumption and standby mode are not suppor
5757
automation* | Can be turned on/off.
5858
scene* | Execution
5959
script* | Execution
60-
sensor | Display values for the following sensor types: temperature, humidity, CO2, PM10, PM25 (others will be displayed but won't have a proper icon)
60+
sensor | Display values for the following sensor types: temperature, humidity, CO2, PM10, PM25, energy, gas and water (others will be displayed but won't have a proper icon).
6161

6262

6363
\* marked are not entities in the true sense of the word, but why have two tables

resources/icons/energy_meter.xcf

9.03 KB
Binary file not shown.

resources/icons/gas_meter.xcf

12.1 KB
Binary file not shown.

resources/icons/water_meter.xcf

9.96 KB
Binary file not shown.

widget/resources/drawables/drawables.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,8 @@
3131
<bitmap id="Humidity" filename="humidity.png" />
3232
<bitmap id="CO2" filename="co2.png" />
3333
<bitmap id="AirPM" filename="molecule.png" />
34+
<bitmap id="EnergyMeter" filename="energy_meter.png" />
35+
<bitmap id="WaterMeter" filename="water_meter.png" />
36+
<bitmap id="GasMeter" filename="gas_meter.png" />
3437
</drawables>
3538
</resources>
2.06 KB
Loading
2.38 KB
Loading
2.15 KB
Loading

widget/source/Entities/EntityListView.mc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,12 @@ class EntityListView extends Ui.View {
319319
drawable = WatchUi.loadResource(Rez.Drawables.CO2);
320320
} else if (sensorClass == Hass.SENSOR_PM) {
321321
drawable = WatchUi.loadResource(Rez.Drawables.AirPM);
322+
} else if (sensorClass == Hass.SENSOR_ENERGY) {
323+
drawable = WatchUi.loadResource(Rez.Drawables.EnergyMeter);
324+
} else if (sensorClass == Hass.SENSOR_WATER) {
325+
drawable = WatchUi.loadResource(Rez.Drawables.WaterMeter);
326+
} else if (sensorClass == Hass.SENSOR_GAS) {
327+
drawable = WatchUi.loadResource(Rez.Drawables.GasMeter);
322328
} else if (sensorClass == Hass.SENSOR_OTHER) {
323329
drawable = WatchUi.loadResource(Rez.Drawables.Unknown);
324330
}

widget/source/hass/Constants.mc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ module Hass {
5959
SENSOR_HUMIDITY,
6060
SENSOR_CO2,
6161
SENSOR_PM,
62+
SENSOR_ENERGY,
63+
SENSOR_GAS,
64+
SENSOR_WATER,
6265
SENSOR_OTHER
6366
}
6467
}

0 commit comments

Comments
 (0)