Dashticz / dashticz_v2

Alternative dashboard for Domoticz
107 stars 60 forks source link

Barometer only devices #407

Open turboproc opened 5 years ago

turboproc commented 5 years ago

When integrating my AgoControl environment with Domoticz/Dashticz I noticed that Dashticz behaves weird when working with devices that are essentially just a barometer, i.e. without a temperature component. When checking main.js, in particular getTempBumBarBlock I understand that a Temp block is always being created, even in the case that no temp information will be available. The issue was quickly fixed by making the creation of the Temp Block depending on the presence of a Temperature device. What I'm not sure is whether I'm destroying a certain concept that I overlooked or whether this was a real ommision.

 if (typeof(device['Temperature']) !== 'undefined') {
       blockValues = [
        {
            icon: 'fa-thermometer-half',
            idx: idx + '_1',
            title: device['Name'],
            value: number_format((typeof(device['Temp']) !== 'undefined') ? device['Temp'] : device['Data'], 1),
            unit: _TEMP_SYMBOL
        }
       ];
    } else {
       blockValues = [];
    };
`
lokonli commented 5 years ago

What is the device type and the device subtype? (You can find them in the Domoticz devices overview)

Interpreting the original code then sometimes there is no 'temperature' field, but only a 'data' field. In that case the 'data' field should be interpreted as temperature. I think we should keep that behavior.