i using bottle create dashboard in html control sonos speaker system.
i have volume slider in html/javascript value want use in python function changes sonos speaker volume. however, don't know how access value in python code.
here code:
<input id="vol-control" type="range" min="0" max="100" value="{{volume}}"step="1" oninput="setvolume(this.value)" onchange="setvolume(this.value)"></input> <script> function setvolume(val) { %from sonosserver import vol_change %vol_change(val) }
when run error "nameerror: name 'val' not defined".
thanks in advance help.
you're confused between frontend , backend code. bottle runs on server; way variable javascript use request, eg via ajax.
Comments
Post a Comment