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

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

$
0
0
I'm getting back on this as my skin still isnt working as intended. There are to issues.
  • When there are no todo items in the list (state key is empty in JSON) it shows all meters without values. The intended behavior is that it should show nothing at all.
  • When there is one item in the list, it repeats this item for all 5 todo meters instead of showing it only as the first item.
Obviously it's related to the RegExp and the IfMatch, IfMatchAction and IfNotMatchAction of the measures but I cant figure out a working solution. ChatGPT is no help either as it keeps suggesting solutions with functions that are not available in Rainmeter skins.

Some help would be appreciated.

Code:

[Rainmeter]Author=MeUpdate=1000AccurateText=1DynamicWindowSize=1[Metadata]Name=Me: TodoDescription=Shows todo items from Home AssistantVersion=1.0.0License=Creative Commons Attribution-Non-Commercial-Share Alike 3.0[Variables]Substitute="&amp;":"&","&quot;":"","&Quot;":"","&lt;br&gt;":"","![CDATA[":"","]]":"","...":"","<":"",">":"","/PRE&gt;":"","PRE&gt;":"","&lt;":"","&#39;":"'","�":"e","�":"e";[STYLES]===========================@Include=#SKINSPATH#Me\@Resources\Styles.inc[Separator]X=0Y=20rW=350H=3SolidColor=255,255,255,35BarOrientation=HORIZONTAL;[MEASURES]=========================[MeasureParent]Measure=WebParserURL=https://hass/api/states/input_text.remindersHeader=Content-Type: application/jsonHeader2=Authorization: Bearer MY_API_KEYUserAgent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36UpdateRate=300RegExp=""state":"([^"]+)""LogSubstringErrors=0[MeasureItem1]Measure=WebParserURL=[MeasureParent]StringIndex=1RegExpSubstitute=1Substitute="([^,]+).*":"\1"Substitute=#Substitute#IfMatch=^.*[,].*$IfMatchAction=[!HideMeter "Item1Box"][!HideMeter "Item1"][!HideMeter "Item1Separator"][!Redraw]IfNotMatchAction=[!ShowMeter "Item1Box"][!ShowMeter "Item1"][!ShowMeter "Item1Separator"][!Redraw][MeasureItem2]Measure=WebParserURL=[MeasureParent]StringIndex=1RegExpSubstitute=1Substitute="[^,]+,\s*([^,]+).*":"\1"Substitute=#Substitute#IfMatch=^.*[,].*$IfMatchAction=[!HideMeter "Item2Box"][!HideMeter "Item2"][!HideMeter "Item2Separator"][!Redraw]IfNotMatchAction=[!ShowMeter "Item2Box"][!ShowMeter "Item2"][!ShowMeter "Item2Separator"][!Redraw][MeasureItem3]Measure=WebParserURL=[MeasureParent]StringIndex=1RegExpSubstitute=1Substitute="[^,]+,\s*[^,]+,\s*([^,]+).*":"\1"Substitute=#Substitute#IfMatch=^.*[,].*$IfMatchAction=[!HideMeter "Item3Box"][!HideMeter "Item3"][!HideMeter "Item3Separator"][!Redraw]IfNotMatchAction=[!ShowMeter "Item3Box"][!ShowMeter "Item3"][!ShowMeter "Item3Separator"][!Redraw][MeasureItem4]Measure=WebParserURL=[MeasureParent]StringIndex=1RegExpSubstitute=1Substitute="[^,]+,\s*[^,]+,\s*[^,]+,\s*([^,]+).*":"\1"Substitute=#Substitute#IfMatch=^.*[,].*$IfMatchAction=[!HideMeter "Item4Box"][!HideMeter "Item4"][!HideMeter "Item4Separator"][!Redraw]IfNotMatchAction=[!ShowMeter "Item4Box"][!ShowMeter "Item4"][!ShowMeter "Item4Separator"][!Redraw][MeasureItem5]Measure=WebParserURL=[MeasureParent]StringIndex=1RegExpSubstitute=1Substitute="[^,]+,\s*[^,]+,\s*[^,]+,\s*[^,]+,\s*([^,]+).*":"\1"Substitute=#Substitute#IfMatch=^.*[,].*$IfMatchAction=[!HideMeter "Item5Box"][!HideMeter "Item5"][!HideMeter "Item5Separator"][!Redraw]IfNotMatchAction=[!ShowMeter "Item5Box"][!ShowMeter "Item5"][!ShowMeter "Item5Separator"][!Redraw];[METERS]==========================[Item1Box]Meter=ShapeShape=Rectangle 0,3,13,13,2 | Fill Color 255,255,255,0 | StrokeWidth 2 | Stroke Color 255,255,255Hidden=1[Item1]Meter=STRINGMeasureName=MeasureItem1X=22Y=0MeterStyle=standaardFontClipString=1Hidden=1[Item1Separator]Meter=IMAGEMeterStyle=SeparatorHidden=1[Item2Box]Meter=ShapeShape=Rectangle 0,40,13,13,2 | Fill Color 255,255,255,0 | StrokeWidth 2 | Stroke Color 255,255,255Hidden=1[Item2]Meter=STRINGMeasureName=MeasureItem2X=22Y=37MeterStyle=standaardFontClipString=1Hidden=1[Item2Separator]Meter=IMAGEMeterStyle=SeparatorHidden=1[Item3Box]Meter=ShapeShape=Rectangle 0,80,13,13,2 | Fill Color 255,255,255,0 | StrokeWidth 2 | Stroke Color 255,255,255Hidden=1[Item3]Meter=STRINGMeasureName=MeasureItem3X=22Y=77MeterStyle=standaardFontClipString=1Hidden=1[Item3Separator]Meter=IMAGEMeterStyle=SeparatorHidden=1[Item4Box]Meter=ShapeShape=Rectangle 0,120,13,13,2 | Fill Color 255,255,255,0 | StrokeWidth 2 | Stroke Color 255,255,255Hidden=1[Item4]Meter=STRINGMeasureName=MeasureItem4MeasureName2=MeasureItem1X=22Y=117MeterStyle=standaardFontClipString=1Hidden=1[Item4Separator]Meter=IMAGEMeterStyle=SeparatorHidden=1[Item5Box]Meter=ShapeShape=Rectangle 0,160,13,13,2 | Fill Color 255,255,255,0 | StrokeWidth 2 | Stroke Color 255,255,255Hidden=1[Item5]Meter=STRINGMeasureName=MeasureItem5MeasureName2=MeasureItem1X=22Y=157MeterStyle=standaardFontClipString=1Hidden=1[Item5Separator]Meter=IMAGEMeterStyle=SeparatorHidden=1

Statistics: Posted by Phuturist — Today, 10:21 am



Viewing all articles
Browse latest Browse all 1044

Trending Articles