<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Help with ma-switch-img]]></title><description><![CDATA[<p dir="auto">Help with ma-switch-img</p>
]]></description><link>https://forum.mango-os.com/topic/3508/help-with-ma-switch-img</link><generator>RSS for Node</generator><lastBuildDate>Mon, 11 May 2026 12:53:27 GMT</lastBuildDate><atom:link href="https://forum.mango-os.com/topic/3508.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 18 May 2018 15:54:42 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Help with ma-switch-img on Mon, 21 May 2018 18:39:39 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/john-beer" aria-label="Profile: john-beer">@<bdi>john-beer</bdi></a> You could use a animated gif if you want to use the switch <code>&lt;ma-switch-img&gt;</code> component.</p>
<p dir="auto">Alternatively you could just style a div to look like a LED indicator using CSS. Here's an example. You can put everything between the <code>&lt;style&gt;</code> tags into a user style sheet if you want to re-use it on multiple pages (Administration, UI settings, User stylesheet URL).</p>
<pre><code>&lt;div class="ma-designer-root" id="1b41b158-5dab-4cb8-8981-1f8861f58bcd" style="width: 1366px; height: 768px; position: relative;"&gt;
    
    &lt;ma-get-point-value point-xid="binary" point="binaryPoint"&gt;&lt;/ma-get-point-value&gt;
    
    &lt;div id="eb9bf90f-9ca2-41f2-9eb1-755b5840c061" style="position: absolute; left: 172px; top: 40px; width: 50px; height: 50px;" class="led" ng-class="{'led-blink': binaryPoint.value}" ng-style="{'background-color': binaryPoint.value ? 'rgb(0, 255, 0)' : 'rgb(255, 0, 0)'}"&gt;
        &lt;div class="led-inner"&gt;&lt;/div&gt;
    &lt;/div&gt;
    
    &lt;div id="20040fcf-9884-4eb6-8e8d-43bf4f5e0a68" style="position: absolute; left: 262px; top: 40px; width: 50px; height: 50px; background-color: rgb(0, 255, 0);" class="led" ng-class="{'led-blink': binaryPoint.value}"&gt;
        &lt;div class="led-inner"&gt;&lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;

&lt;style&gt;

.led {
    border: 5px solid grey;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 5px 5px 5px rgba(30,30,30,0.7);
}

.led-inner {
    height: 100%;
    width: 100%;
    border-radius: inherit;
}

.led-inner:after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(rgba(255,255,255,0.3),rgba(0,0,0,0.3));
}

.led-blink .led-inner {
    animation: led-blink 1s ease-in-out infinite;
}

@keyframes led-blink {
    0% {
        background-color: rgba(0,0,0,0);
    }
    50% {
        background-color: rgba(0,0,0,1);
    }
}

&lt;/style&gt;
</code></pre>
]]></description><link>https://forum.mango-os.com/post/18528</link><guid isPermaLink="true">https://forum.mango-os.com/post/18528</guid><dc:creator><![CDATA[Jared Wiltshire]]></dc:creator><pubDate>Mon, 21 May 2018 18:39:39 GMT</pubDate></item><item><title><![CDATA[Reply to Help with ma-switch-img on Mon, 21 May 2018 09:00:25 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jared-wiltshire" aria-label="Profile: jared-wiltshire">@<bdi>jared-wiltshire</bdi></a> When do you want it to blink between green and grey? When the point value is true?<br />
<strong>Ans.</strong> Yes. point value is true.blink between green and grey. Where can I set up?</p>
<p dir="auto">Thank you</p>
]]></description><link>https://forum.mango-os.com/post/18520</link><guid isPermaLink="true">https://forum.mango-os.com/post/18520</guid><dc:creator><![CDATA[JoHn-Beer]]></dc:creator><pubDate>Mon, 21 May 2018 09:00:25 GMT</pubDate></item><item><title><![CDATA[Reply to Help with ma-switch-img on Fri, 18 May 2018 15:58:15 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/john-beer" aria-label="Profile: JoHn-Beer">@<bdi>JoHn-Beer</bdi></a> I moved your post to a new topic. Please create a new topic when you ask new questions, it helps everyone (including us at IAS) find it.</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/john-beer" aria-label="Profile: john-beer">@<bdi>john-beer</bdi></a> said in <a href="/post/18491">Help with ma-switch-img</a>:</p>
<blockquote>
<p dir="auto">If the value is true, show the green light. If the value is false, show the red light.If the value is default, show the grey light</p>
</blockquote>
<p dir="auto">The markup you posted looks correct for what you have described, except that if it is a binary data point then the value is always true or false, there is no scenario where the default would be shown (except before any point values are polled and there is no value).</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/john-beer" aria-label="Profile: john-beer">@<bdi>john-beer</bdi></a> said in <a href="/post/18491">Help with ma-switch-img</a>:</p>
<blockquote>
<p dir="auto">I want the light to blink between green and gray.Where do I set it? Or any component that works the way I want it?</p>
</blockquote>
<p dir="auto">When do you want it to blink between green and grey? When the point value is true?</p>
]]></description><link>https://forum.mango-os.com/post/18503</link><guid isPermaLink="true">https://forum.mango-os.com/post/18503</guid><dc:creator><![CDATA[Jared Wiltshire]]></dc:creator><pubDate>Fri, 18 May 2018 15:58:15 GMT</pubDate></item><item><title><![CDATA[Reply to Help with ma-switch-img on Fri, 18 May 2018 09:50:09 GMT]]></title><description><![CDATA[<p dir="auto">Hi <a class="plugin-mentions-user plugin-mentions-a" href="/user/phildunlap" aria-label="Profile: phildunlap">@<bdi>phildunlap</bdi></a> I want you to help me.<br />
<code> &lt;ma-switch-img id="963fcec0-a854-4b84-8fd9-287efaa10f72" default-src="/rest/v2/file-stores/default/gray-led-circle-3-md.png" src-false="/rest/v2/file-stores/default/red-led-circle-3-hi.png" src-true="/rest/v2/file-stores/default/led-green-hi.png" point-xid="internal_mango_num_data_points"&gt;&lt;/ma-switch-img&gt;</code></p>
<p dir="auto">If the value is true, show the green light. If the value is false, show the red light.If the value is default, show the grey light.I want the light to blink between green and gray.Where do I set it? Or any component that works the way I want it?</p>
<p dir="auto">Thankyou.</p>
]]></description><link>https://forum.mango-os.com/post/18491</link><guid isPermaLink="true">https://forum.mango-os.com/post/18491</guid><dc:creator><![CDATA[JoHn-Beer]]></dc:creator><pubDate>Fri, 18 May 2018 09:50:09 GMT</pubDate></item></channel></rss>