Skip to content
Snippets Groups Projects
Commit 9911eb12 authored by jkerdreu's avatar jkerdreu
Browse files

Added from ensibs (not tested)


git-svn-id: https://redmine.imt-atlantique.fr/svn/xaal/code/Python/branches/0.7@2956 b32b6428-25c9-4566-ad07-03861ab6144f
parent 0adb0130
No related branches found
No related tags found
No related merge requests found
<fall>
<table width=80%>
<tr>
<td>
<span class="motion">
<span class="{class}">⚛</span>
</span>
</td>
<td>
<span class="X"> X : { X }</span><br/>
<span class="Y"> Y : { Y }</span><br/>
<span class="Delay"> Delay : {Delay}&nbsp;s</span><br/>
</td>
</tr>
</table>
<script>
this.addr = opts.xaal_addr
this.X = null;
this.Y = null;
this.Delay = null;
this.class = "no_motion"
receive(data) {
this.Delay = data['attributes']['Delay (s)']
this.X = data['attributes']['X'];
this.Y = data['attributes']['Y'];
if (data.attributes['fall'] == true) {
this.class = 'motion'
}
else {
this.class = 'no_motion'
}
this.update()
}
</script>
<style>
. {
font-weight: bold;
color : var(--color1);
}
.motion {
font-weight: bold;
color : var(--color3);
}
.no_motion {
font-weight: bold;
color : var(--color2);
align: center;}
table, tr {border:hidden;}
td, th {border:hidden;}
motion.span {
min-height: 100px;
display: inline-flex;
align-items: center;
}
fall.span {
text-align: right;
}
</style>
</fall>
<lightgauge>
<span class="lightgauge">
<span class="brightness">{ brightness }&nbsp;%</span>
</span>
<script>
this.addr = opts.xaal_addr;
this.brightness = '__';
receive(data) {
this.brightness = data['attributes']['brightness'];
this.update();
}
</script>
<style>
.brightness {
font-weight: bold;
color : var(--color1);
align: center;
}
</style>
</lightgauge>
<siren>
<div class="onoffswitch">
<input type="checkbox" class="onoffswitch-checkbox" id={ tag_id } onchange={ chk } checked={checked}>
<label class="onoffswitch-label" for={ tag_id }>
<span class="onoffswitch-inner"></span>
<span class="onoffswitch-switch"></span>
</label>
</div>
<script>
this.addr = opts.xaal_addr
this.tag_id = 'btn_'+Math.random();
receive(data) {
state = data['attributes']['light']
if (state == true) {
this.checked = true
}
else {
this.checked = false
}
this.update()
}
chk(e) {
if (e.target.checked == true)
sio_send_request(this.addr,'play',{})
else
sio_send_request(this.addr,'stop',{})
}
</script>
<style>
</style>
</siren>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment