First fixes for charging station theme

This commit is contained in:
pietervdvn 2022-02-17 23:58:03 +01:00
parent f55e5cf26c
commit 2742f03ebf
2 changed files with 747 additions and 380 deletions

File diff suppressed because it is too large Load diff

View file

@ -72,13 +72,17 @@ function run(file, protojson) {
for (let i = 0; i < entries.length; i++) { for (let i = 0; i < entries.length; i++) {
const e = entries[i]; const e = entries[i];
const txt = { const txt = {
en: `<div class='flex'><img class='w-12 mx-4' src='./assets/layers/charging_station/${e.image}'/> <span>${e.description.get("en")}</span></div>`, en: e.description.get("en"),
nl: `<div class='flex'><img class='w-12 mx-4' src='./assets/layers/charging_station/${e.image}'/> <span>${e.description.get("nl")}</span></div>` nl: e.description.get("nl")
} }
const json = { const json = {
if: `${e.key}=1`, if: `${e.key}=1`,
ifnot: `${e.key}=`, ifnot: `${e.key}=`,
then: txt, then: txt,
icon:{
path:"./assets/layers/charging_station/" + e.image,
class:"medium"
}
} }
if (e.countryWhiteList.length > 0 && e.countryBlackList.length > 0) { if (e.countryWhiteList.length > 0 && e.countryBlackList.length > 0) {
@ -125,7 +129,11 @@ function run(file, protojson) {
and:Utils.NoEmpty( [`${e.key}~*`, `${e.key}!=1`, ...e.extraVisualisationCondition.split(";")]) and:Utils.NoEmpty( [`${e.key}~*`, `${e.key}!=1`, ...e.extraVisualisationCondition.split(";")])
}, },
then: txt, then: txt,
hideInAnswer: true hideInAnswer: true,
icon:{
path: e.image,
class:"medium"
}
} }
overview_question_answers.push(no_ask_json) overview_question_answers.push(no_ask_json)
@ -170,8 +178,12 @@ function run(file, protojson) {
return { return {
if: `socket:${e.key}:voltage=${voltage} V`, if: `socket:${e.key}:voltage=${voltage} V`,
then: { then: {
en: `${descrWithImage_en} outputs ${voltage} volt`, en: `${e.description.get("en")} outputs ${voltage} volt`,
nl: `${descrWithImage_nl} heeft een spanning van ${voltage} volt` nl: `${e.description.get("nl")} heeft een spanning van ${voltage} volt`
},
icon: {
path: `./assets/layers/charging_station/${e.image}`,
class:"medium"
} }
} }
}), }),
@ -200,8 +212,12 @@ function run(file, protojson) {
return { return {
if: `socket:${e.key}:current=${current} A`, if: `socket:${e.key}:current=${current} A`,
then: { then: {
en: `${descrWithImage_en} outputs at most ${current} A`, en: `${e.description.get("en")} outputs at most ${current} A`,
nl: `${descrWithImage_nl} levert een stroom van maximaal ${current} A` nl: `${e.description.get("nl")} levert een stroom van maximaal ${current} A`
},
icon: {
path: `./assets/layers/charging_station/${e.image}`,
class:"medium"
} }
} }
}), }),
@ -230,8 +246,12 @@ function run(file, protojson) {
return { return {
if: `socket:${e.key}:output=${output}`, if: `socket:${e.key}:output=${output}`,
then: { then: {
en: `${descrWithImage_en} outputs at most ${output}`, en: `${e.description.get("en")} outputs at most ${output} A`,
nl: `${descrWithImage_nl} levert een vermogen van maximaal ${output}` nl: `${e.description.get("nl")} levert een vermogen van maximaal ${output} A`
},
icon: {
path: `./assets/layers/charging_station/${e.image}`,
class:"medium"
} }
} }
}), }),