Skip to content
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ switch | Only turning on/off, energy consumption and standby mode are not suppor
automation* | Can be turned on/off.
scene* | Execution
script* | Execution
sensor | Display values for the following sensor types: temperature, humidity, CO2, PM10, PM25 (others will be displayed but won't have a proper icon)
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).


\* marked are not entities in the true sense of the word, but why have two tables
Expand Down
Binary file added resources/icons/energy_meter.xcf
Binary file not shown.
Binary file added resources/icons/gas_meter.xcf
Binary file not shown.
Binary file added resources/icons/water_meter.xcf
Binary file not shown.
3 changes: 3 additions & 0 deletions widget/resources/drawables/drawables.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,8 @@
<bitmap id="Humidity" filename="humidity.png" />
<bitmap id="CO2" filename="co2.png" />
<bitmap id="AirPM" filename="molecule.png" />
<bitmap id="EnergyMeter" filename="energy_meter.png" />
<bitmap id="WaterMeter" filename="water_meter.png" />
<bitmap id="GasMeter" filename="gas_meter.png" />
</drawables>
</resources>
Binary file added widget/resources/drawables/energy_meter.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added widget/resources/drawables/gas_meter.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added widget/resources/drawables/water_meter.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions widget/source/Entities/EntityListView.mc
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,12 @@ class EntityListView extends Ui.View {
drawable = WatchUi.loadResource(Rez.Drawables.CO2);
} else if (sensorClass == Hass.SENSOR_PM) {
drawable = WatchUi.loadResource(Rez.Drawables.AirPM);
} else if (sensorClass == Hass.SENSOR_ENERGY) {
drawable = WatchUi.loadResource(Rez.Drawables.EnergyMeter);
} else if (sensorClass == Hass.SENSOR_WATER) {
drawable = WatchUi.loadResource(Rez.Drawables.WaterMeter);
} else if (sensorClass == Hass.SENSOR_GAS) {
drawable = WatchUi.loadResource(Rez.Drawables.GasMeter);
} else if (sensorClass == Hass.SENSOR_OTHER) {
drawable = WatchUi.loadResource(Rez.Drawables.Unknown);
}
Expand Down
3 changes: 3 additions & 0 deletions widget/source/hass/Constants.mc
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ module Hass {
SENSOR_HUMIDITY,
SENSOR_CO2,
SENSOR_PM,
SENSOR_ENERGY,
SENSOR_GAS,
SENSOR_WATER,
SENSOR_OTHER
}
}
6 changes: 6 additions & 0 deletions widget/source/hass/Hass.mc
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,12 @@ module Hass {
sensorClass = SENSOR_PM;
} else if (sensorClassStr.find("pm10") != null) {
sensorClass = SENSOR_PM;
} else if (sensorClassStr.find("energy") != null) {
sensorClass = SENSOR_ENERGY;
} else if (sensorClassStr.find("water") != null) {
sensorClass = SENSOR_WATER;
} else if (sensorClassStr.find("gas") != null) {
sensorClass = SENSOR_GAS;
}
} else {
sensorClass = SENSOR_OTHER;
Expand Down