forked from DigiLive/mushroom-strategy
Fix bugs
Fix sensor duplication and made cover count more accurate
This commit is contained in:
9
dist/mushroom-strategy.js
vendored
9
dist/mushroom-strategy.js
vendored
@@ -418,7 +418,7 @@ class MushroomStrategy {
|
||||
}
|
||||
|
||||
// Cover count
|
||||
const coverCountTemplate = "{% set covers = [" + createListOfFilteredStates(entities, devices, definedAreas, "cover.") + "]%} {{ covers | selectattr('state','ne','closed') | list | count }}"
|
||||
const coverCountTemplate = "{% set covers = [" + createListOfFilteredStates(entities, devices, definedAreas, "cover.") + "]%} {{ covers | selectattr('state','eq','open') | list | count }}"
|
||||
if (strategyOptions.chips == null || (strategyOptions.chips != null && strategyOptions.chips.cover_count != false))
|
||||
{
|
||||
chips.push
|
||||
@@ -1105,6 +1105,7 @@ class MushroomStrategy {
|
||||
subtitle: "Sensors"
|
||||
},
|
||||
);
|
||||
sensorsLoop:
|
||||
for (const sensor of sensors)
|
||||
{
|
||||
// Find the state obj that matches with current sensor
|
||||
@@ -1155,8 +1156,11 @@ class MushroomStrategy {
|
||||
...config
|
||||
},
|
||||
);
|
||||
continue sensorsLoop;
|
||||
}
|
||||
}
|
||||
|
||||
} if (sensorStateObj.attributes.unit_of_measurement != null)
|
||||
if (sensorStateObj.attributes.unit_of_measurement != null)
|
||||
{
|
||||
sensorCards.push
|
||||
(
|
||||
@@ -1183,7 +1187,6 @@ class MushroomStrategy {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
cards.push
|
||||
(
|
||||
{
|
||||
|
Reference in New Issue
Block a user