Quantcast
Channel: Rainmeter Forums
Viewing all articles
Browse latest Browse all 529

Help: Rainmeter Skins • Hide meters when no value available from WebParser

$
0
0
I'm retrieving a JSON that looks like this.

Code:

{    "entity_id": "input_text.reminders",    "state": "reminder text 1, reminder text 2, reminder text 3, reminder text 4",    "attributes": {        "editable": true,        "min": 0,        "max": 9999999,        "pattern": null,        "mode": "text",        "icon": "mdi:checkbox-marked-circle-auto-outline",        "friendly_name": "Reminders"    }}
I want to show the first 5 values from the comma separated state object. So I created the config as shown below. Probably not very elegant but it shows the values. The problem is that sometimes there are less than 5 values in the state object and I need to hide the meters related to the missing values. I somehow need to check if the value is present and if not hide the meters. How do I do this?

Code:

[MeasureParent]Measure=WebParserURL=https://some.urlUpdateRate=300RegExp="\"state\":\"([^\"]+)\""[MeasureItem1]Measure=WebParserURL=[MeasureParent]StringIndex=1RegExpSubstitute=1Substitute="([^,]+).*":"\1"Substitute=#Substitute#[MeasureItem2]Measure=WebParserURL=[MeasureParent]StringIndex=1RegExpSubstitute=1Substitute="[^,]+,\s*([^,]+).*":"\1"Substitute=#Substitute#[MeasureItem3]Measure=WebParserURL=[MeasureParent]StringIndex=1RegExpSubstitute=1Substitute="[^,]+,\s*[^,]+,\s*([^,]+).*":"\1"Substitute=#Substitute#[MeasureItem4]Measure=WebParserURL=[MeasureParent]StringIndex=1RegExpSubstitute=1Substitute="[^,]+,\s*[^,]+,\s*[^,]+,\s*([^,]+).*":"\1"Substitute=#Substitute#[MeasureItem5]Measure=WebParserURL=[MeasureParent]StringIndex=1RegExpSubstitute=1Substitute="[^,]+,\s*[^,]+,\s*[^,]+,\s*[^,]+,\s*([^,]+).*":"\1"Substitute=#Substitute#;[METERS]==========================[Item1Box]Meter=ShapeShape=Rectangle 0,3,13,13,2 | Fill Color 255,255,255,0 | StrokeWidth 2 | Stroke Color 255,255,255[Item1]Meter=STRINGMeasureName=MeasureItem1X=22Y=0MeterStyle=standaardFont[Item1Separator]Meter=IMAGEMeterStyle=Separator[Item2Box]Meter=ShapeShape=Rectangle 0,40,13,13,2 | Fill Color 255,255,255,0 | StrokeWidth 2 | Stroke Color 255,255,255[Item2]Meter=STRINGMeasureName=MeasureItem2X=22Y=37MeterStyle=standaardFont[Item2Separator]Meter=IMAGEMeterStyle=Separator[Item3Box]Meter=ShapeShape=Rectangle 0,80,13,13,2 | Fill Color 255,255,255,0 | StrokeWidth 2 | Stroke Color 255,255,255[Item3]Meter=STRINGMeasureName=MeasureItem3X=22Y=77MeterStyle=standaardFont[Item3Separator]Meter=IMAGEMeterStyle=Separator[Item4Box]Meter=ShapeShape=Rectangle 0,120,13,13,2 | Fill Color 255,255,255,0 | StrokeWidth 2 | Stroke Color 255,255,255[Item4]Meter=STRINGMeasureName=MeasureItem4MeasureName2=MeasureItem1X=22Y=117MeterStyle=standaardFontClipString=1[Item4Separator]Meter=IMAGEMeterStyle=Separator[Item5Box]Meter=ShapeShape=Rectangle 0,160,13,13,2 | Fill Color 255,255,255,0 | StrokeWidth 2 | Stroke Color 255,255,255[Item5]Meter=STRINGMeasureName=MeasureItem5MeasureName2=MeasureItem1X=22Y=157MeterStyle=standaardFontClipString=1[Item5Separator]Meter=IMAGEMeterStyle=Separator

Statistics: Posted by Phuturist — Today, 5:47 pm — Replies 0 — Views 9



Viewing all articles
Browse latest Browse all 529

Trending Articles