diff options
author | jakob.stendahl <jakob.stendahl@infomedia.dk> | 2022-12-12 14:13:40 +0100 |
---|---|---|
committer | Jakob Stendahl <jakob.stendahl@outlook.com> | 2022-12-12 14:13:40 +0100 |
commit | 4189c0c988daa939be0e8ec979ce0ae0563c4b7d (patch) | |
tree | f07143ac71bd80457f681ec64bde1bbcbefa7a08 /public/docs/Scripting/NeoBehaviour/index.html | |
parent | f1664d7c0dda8b4e557a02cd6fbfe56308daa4e4 (diff) | |
download | Luxcena-Neo-4189c0c988daa939be0e8ec979ce0ae0563c4b7d.tar.gz Luxcena-Neo-4189c0c988daa939be0e8ec979ce0ae0563c4b7d.zip |
Create docs from python code
Diffstat (limited to 'public/docs/Scripting/NeoBehaviour/index.html')
-rw-r--r-- | public/docs/Scripting/NeoBehaviour/index.html | 1851 |
1 files changed, 1851 insertions, 0 deletions
diff --git a/public/docs/Scripting/NeoBehaviour/index.html b/public/docs/Scripting/NeoBehaviour/index.html new file mode 100644 index 0000000..7d049d8 --- /dev/null +++ b/public/docs/Scripting/NeoBehaviour/index.html @@ -0,0 +1,1851 @@ + +<!doctype html> +<html lang="en" class="no-js"> + <head> + + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width,initial-scale=1"> + + + + <link rel="icon" href="../../assets/images/favicon.png"> + <meta name="generator" content="mkdocs-1.4.2, mkdocs-material-8.5.10"> + + + + <title>Main interface - Luxcena Neo Documentation</title> + + + + <link rel="stylesheet" href="../../assets/stylesheets/main.975780f9.min.css"> + + + <link rel="stylesheet" href="../../assets/stylesheets/palette.2505c338.min.css"> + + + + + + + + + + + <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> + <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,300i,400,400i,700,700i%7CRoboto+Mono:400,400i,700,700i&display=fallback"> + <style>:root{--md-text-font:"Roboto";--md-code-font:"Roboto Mono"}</style> + + + + <link rel="stylesheet" href="../../assets/_mkdocstrings.css"> + + <link rel="stylesheet" href="../../assets/luxcena-colors.css"> + + <script>__md_scope=new URL("../..",location),__md_hash=e=>[...e].reduce((e,_)=>(e<<5)-e+_.charCodeAt(0),0),__md_get=(e,_=localStorage,t=__md_scope)=>JSON.parse(_.getItem(t.pathname+"."+e)),__md_set=(e,_,t=localStorage,a=__md_scope)=>{try{t.setItem(a.pathname+"."+e,JSON.stringify(_))}catch(e){}}</script> + + + + + + + </head> + + + + + + + + <body dir="ltr" data-md-color-scheme="default" data-md-color-primary="None" data-md-color-accent="None"> + + + + <input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off"> + <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off"> + <label class="md-overlay" for="__drawer"></label> + <div data-md-component="skip"> + + + <a href="#documentation-for-neobehaviour" class="md-skip"> + Skip to content + </a> + + </div> + <div data-md-component="announce"> + + </div> + + + + +<header class="md-header" data-md-component="header"> + <nav class="md-header__inner md-grid" aria-label="Header"> + <a href="../.." title="Luxcena Neo Documentation" class="md-header__button md-logo" aria-label="Luxcena Neo Documentation" data-md-component="logo"> + + + <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 8a3 3 0 0 0 3-3 3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3m0 3.54C9.64 9.35 6.5 8 3 8v11c3.5 0 6.64 1.35 9 3.54 2.36-2.19 5.5-3.54 9-3.54V8c-3.5 0-6.64 1.35-9 3.54Z"/></svg> + + </a> + <label class="md-header__button md-icon" for="__drawer"> + <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 6h18v2H3V6m0 5h18v2H3v-2m0 5h18v2H3v-2Z"/></svg> + </label> + <div class="md-header__title" data-md-component="header-title"> + <div class="md-header__ellipsis"> + <div class="md-header__topic"> + <span class="md-ellipsis"> + Luxcena Neo Documentation + </span> + </div> + <div class="md-header__topic" data-md-component="header-topic"> + <span class="md-ellipsis"> + + Main interface + + </span> + </div> + </div> + </div> + + + + + </nav> + +</header> + + <div class="md-container" data-md-component="container"> + + + + + + + <main class="md-main" data-md-component="main"> + <div class="md-main__inner md-grid"> + + + + <div class="md-sidebar md-sidebar--primary" data-md-component="sidebar" data-md-type="navigation" > + <div class="md-sidebar__scrollwrap"> + <div class="md-sidebar__inner"> + + + +<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0"> + <label class="md-nav__title" for="__drawer"> + <a href="../.." title="Luxcena Neo Documentation" class="md-nav__button md-logo" aria-label="Luxcena Neo Documentation" data-md-component="logo"> + + + <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 8a3 3 0 0 0 3-3 3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3m0 3.54C9.64 9.35 6.5 8 3 8v11c3.5 0 6.64 1.35 9 3.54 2.36-2.19 5.5-3.54 9-3.54V8c-3.5 0-6.64 1.35-9 3.54Z"/></svg> + + </a> + Luxcena Neo Documentation + </label> + + <ul class="md-nav__list" data-md-scrollfix> + + + + + + + + + <li class="md-nav__item"> + <a href="../.." class="md-nav__link"> + Introduction + </a> + </li> + + + + + + + + + + + <li class="md-nav__item"> + <a href="../../FuturePlan/" class="md-nav__link"> + Plan for the future + </a> + </li> + + + + + + + + + + + + <li class="md-nav__item md-nav__item--nested"> + + + <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_3" type="checkbox" id="__nav_3" > + + + + + <label class="md-nav__link" for="__nav_3"> + Usage + <span class="md-nav__icon md-icon"></span> + </label> + + <nav class="md-nav" aria-label="Usage" data-md-level="1"> + <label class="md-nav__title" for="__nav_3"> + <span class="md-nav__icon md-icon"></span> + Usage + </label> + <ul class="md-nav__list" data-md-scrollfix> + + + + + + + <li class="md-nav__item"> + <a href="../../Usage/Install/" class="md-nav__link"> + Install + </a> + </li> + + + + + + + + + + <li class="md-nav__item"> + <a href="../../Usage/Configuration/" class="md-nav__link"> + Configuration + </a> + </li> + + + + + + + + + + <li class="md-nav__item"> + <a href="../../Usage/CLI/" class="md-nav__link"> + CLI + </a> + </li> + + + + + </ul> + </nav> + </li> + + + + + + + + + + + + + + <li class="md-nav__item md-nav__item--active md-nav__item--nested"> + + + <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_4" type="checkbox" id="__nav_4" checked> + + + + + <label class="md-nav__link" for="__nav_4"> + Scripting + <span class="md-nav__icon md-icon"></span> + </label> + + <nav class="md-nav" aria-label="Scripting" data-md-level="1"> + <label class="md-nav__title" for="__nav_4"> + <span class="md-nav__icon md-icon"></span> + Scripting + </label> + <ul class="md-nav__list" data-md-scrollfix> + + + + + + + <li class="md-nav__item"> + <a href="../Strip/" class="md-nav__link"> + Strip + </a> + </li> + + + + + + + + + + + + <li class="md-nav__item md-nav__item--active"> + + <input class="md-nav__toggle md-toggle" data-md-toggle="toc" type="checkbox" id="__toc"> + + + + + + <label class="md-nav__link md-nav__link--active" for="__toc"> + Main interface + <span class="md-nav__icon md-icon"></span> + </label> + + <a href="./" class="md-nav__link md-nav__link--active"> + Main interface + </a> + + + +<nav class="md-nav md-nav--secondary" aria-label="Table of contents"> + + + + + + + <label class="md-nav__title" for="__toc"> + <span class="md-nav__icon md-icon"></span> + Table of contents + </label> + <ul class="md-nav__list" data-md-component="toc" data-md-scrollfix> + + <li class="md-nav__item"> + <a href="#luxcena_neo.neo_behaviour.NeoBehaviour" class="md-nav__link"> + NeoBehaviour + </a> + + <nav class="md-nav" aria-label="NeoBehaviour"> + <ul class="md-nav__list"> + + <li class="md-nav__item"> + <a href="#luxcena_neo.neo_behaviour.NeoBehaviour.declare_variables" class="md-nav__link"> + declare_variables() + </a> + +</li> + + <li class="md-nav__item"> + <a href="#luxcena_neo.neo_behaviour.NeoBehaviour.each_day" class="md-nav__link"> + each_day() + </a> + +</li> + + <li class="md-nav__item"> + <a href="#luxcena_neo.neo_behaviour.NeoBehaviour.each_hour" class="md-nav__link"> + each_hour() + </a> + +</li> + + <li class="md-nav__item"> + <a href="#luxcena_neo.neo_behaviour.NeoBehaviour.each_minute" class="md-nav__link"> + each_minute() + </a> + +</li> + + <li class="md-nav__item"> + <a href="#luxcena_neo.neo_behaviour.NeoBehaviour.each_second" class="md-nav__link"> + each_second() + </a> + +</li> + + <li class="md-nav__item"> + <a href="#luxcena_neo.neo_behaviour.NeoBehaviour.each_tick" class="md-nav__link"> + each_tick() + </a> + +</li> + + <li class="md-nav__item"> + <a href="#luxcena_neo.neo_behaviour.NeoBehaviour.on_start" class="md-nav__link"> + on_start() + </a> + +</li> + + <li class="md-nav__item"> + <a href="#an-example-of-the-usage-of-the-class" class="md-nav__link"> + An example of the usage of the class + </a> + +</li> + + </ul> + </nav> + +</li> + + <li class="md-nav__item"> + <a href="#luxcena_neo.neo_behaviour.Variable" class="md-nav__link"> + Variable + </a> + + <nav class="md-nav" aria-label="Variable"> + <ul class="md-nav__list"> + + <li class="md-nav__item"> + <a href="#luxcena_neo.neo_behaviour.Variable.value" class="md-nav__link"> + value + </a> + +</li> + + <li class="md-nav__item"> + <a href="#luxcena_neo.neo_behaviour.Variable.__init__" class="md-nav__link"> + __init__() + </a> + +</li> + + </ul> + </nav> + +</li> + + <li class="md-nav__item"> + <a href="#luxcena_neo.neo_behaviour.ColorVariable" class="md-nav__link"> + ColorVariable + </a> + + <nav class="md-nav" aria-label="ColorVariable"> + <ul class="md-nav__list"> + + <li class="md-nav__item"> + <a href="#luxcena_neo.neo_behaviour.ColorVariable.__init__" class="md-nav__link"> + __init__() + </a> + +</li> + + </ul> + </nav> + +</li> + + <li class="md-nav__item"> + <a href="#luxcena_neo.neo_behaviour.IntegerVariable" class="md-nav__link"> + IntegerVariable + </a> + + <nav class="md-nav" aria-label="IntegerVariable"> + <ul class="md-nav__list"> + + <li class="md-nav__item"> + <a href="#luxcena_neo.neo_behaviour.IntegerVariable.__init__" class="md-nav__link"> + __init__() + </a> + +</li> + + </ul> + </nav> + +</li> + + <li class="md-nav__item"> + <a href="#luxcena_neo.neo_behaviour.FloatVariable" class="md-nav__link"> + FloatVariable + </a> + + <nav class="md-nav" aria-label="FloatVariable"> + <ul class="md-nav__list"> + + <li class="md-nav__item"> + <a href="#luxcena_neo.neo_behaviour.FloatVariable.__init__" class="md-nav__link"> + __init__() + </a> + +</li> + + </ul> + </nav> + +</li> + + <li class="md-nav__item"> + <a href="#luxcena_neo.neo_behaviour.BooleanVariable" class="md-nav__link"> + BooleanVariable + </a> + + <nav class="md-nav" aria-label="BooleanVariable"> + <ul class="md-nav__list"> + + <li class="md-nav__item"> + <a href="#luxcena_neo.neo_behaviour.BooleanVariable.__init__" class="md-nav__link"> + __init__() + </a> + +</li> + + </ul> + </nav> + +</li> + + <li class="md-nav__item"> + <a href="#luxcena_neo.neo_behaviour.Trigger" class="md-nav__link"> + Trigger + </a> + + <nav class="md-nav" aria-label="Trigger"> + <ul class="md-nav__list"> + + <li class="md-nav__item"> + <a href="#luxcena_neo.neo_behaviour.Trigger.__init__" class="md-nav__link"> + __init__() + </a> + +</li> + + </ul> + </nav> + +</li> + + </ul> + +</nav> + + </li> + + + + + </ul> + </nav> + </li> + + + + + + + + + + + + <li class="md-nav__item md-nav__item--nested"> + + + <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_5" type="checkbox" id="__nav_5" > + + + + + <label class="md-nav__link" for="__nav_5"> + Code Documentation + <span class="md-nav__icon md-icon"></span> + </label> + + <nav class="md-nav" aria-label="Code Documentation" data-md-level="1"> + <label class="md-nav__title" for="__nav_5"> + <span class="md-nav__icon md-icon"></span> + Code Documentation + </label> + <ul class="md-nav__list" data-md-scrollfix> + + + + + + + <li class="md-nav__item"> + <a href="../../Code%20Documentation/Run/" class="md-nav__link"> + Run + </a> + </li> + + + + + + + + + + + <li class="md-nav__item md-nav__item--nested"> + + + <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_5_2" type="checkbox" id="__nav_5_2" > + + + + + <label class="md-nav__link" for="__nav_5_2"> + API + <span class="md-nav__icon md-icon"></span> + </label> + + <nav class="md-nav" aria-label="API" data-md-level="2"> + <label class="md-nav__title" for="__nav_5_2"> + <span class="md-nav__icon md-icon"></span> + API + </label> + <ul class="md-nav__list" data-md-scrollfix> + + + + + + + <li class="md-nav__item"> + <a href="../../Code%20Documentation/SocketIO/" class="md-nav__link"> + Socket-IO + </a> + </li> + + + + + </ul> + </nav> + </li> + + + + + </ul> + </nav> + </li> + + + + </ul> +</nav> + </div> + </div> + </div> + + + + <div class="md-sidebar md-sidebar--secondary" data-md-component="sidebar" data-md-type="toc" > + <div class="md-sidebar__scrollwrap"> + <div class="md-sidebar__inner"> + + +<nav class="md-nav md-nav--secondary" aria-label="Table of contents"> + + + + + + + <label class="md-nav__title" for="__toc"> + <span class="md-nav__icon md-icon"></span> + Table of contents + </label> + <ul class="md-nav__list" data-md-component="toc" data-md-scrollfix> + + <li class="md-nav__item"> + <a href="#luxcena_neo.neo_behaviour.NeoBehaviour" class="md-nav__link"> + NeoBehaviour + </a> + + <nav class="md-nav" aria-label="NeoBehaviour"> + <ul class="md-nav__list"> + + <li class="md-nav__item"> + <a href="#luxcena_neo.neo_behaviour.NeoBehaviour.declare_variables" class="md-nav__link"> + declare_variables() + </a> + +</li> + + <li class="md-nav__item"> + <a href="#luxcena_neo.neo_behaviour.NeoBehaviour.each_day" class="md-nav__link"> + each_day() + </a> + +</li> + + <li class="md-nav__item"> + <a href="#luxcena_neo.neo_behaviour.NeoBehaviour.each_hour" class="md-nav__link"> + each_hour() + </a> + +</li> + + <li class="md-nav__item"> + <a href="#luxcena_neo.neo_behaviour.NeoBehaviour.each_minute" class="md-nav__link"> + each_minute() + </a> + +</li> + + <li class="md-nav__item"> + <a href="#luxcena_neo.neo_behaviour.NeoBehaviour.each_second" class="md-nav__link"> + each_second() + </a> + +</li> + + <li class="md-nav__item"> + <a href="#luxcena_neo.neo_behaviour.NeoBehaviour.each_tick" class="md-nav__link"> + each_tick() + </a> + +</li> + + <li class="md-nav__item"> + <a href="#luxcena_neo.neo_behaviour.NeoBehaviour.on_start" class="md-nav__link"> + on_start() + </a> + +</li> + + <li class="md-nav__item"> + <a href="#an-example-of-the-usage-of-the-class" class="md-nav__link"> + An example of the usage of the class + </a> + +</li> + + </ul> + </nav> + +</li> + + <li class="md-nav__item"> + <a href="#luxcena_neo.neo_behaviour.Variable" class="md-nav__link"> + Variable + </a> + + <nav class="md-nav" aria-label="Variable"> + <ul class="md-nav__list"> + + <li class="md-nav__item"> + <a href="#luxcena_neo.neo_behaviour.Variable.value" class="md-nav__link"> + value + </a> + +</li> + + <li class="md-nav__item"> + <a href="#luxcena_neo.neo_behaviour.Variable.__init__" class="md-nav__link"> + __init__() + </a> + +</li> + + </ul> + </nav> + +</li> + + <li class="md-nav__item"> + <a href="#luxcena_neo.neo_behaviour.ColorVariable" class="md-nav__link"> + ColorVariable + </a> + + <nav class="md-nav" aria-label="ColorVariable"> + <ul class="md-nav__list"> + + <li class="md-nav__item"> + <a href="#luxcena_neo.neo_behaviour.ColorVariable.__init__" class="md-nav__link"> + __init__() + </a> + +</li> + + </ul> + </nav> + +</li> + + <li class="md-nav__item"> + <a href="#luxcena_neo.neo_behaviour.IntegerVariable" class="md-nav__link"> + IntegerVariable + </a> + + <nav class="md-nav" aria-label="IntegerVariable"> + <ul class="md-nav__list"> + + <li class="md-nav__item"> + <a href="#luxcena_neo.neo_behaviour.IntegerVariable.__init__" class="md-nav__link"> + __init__() + </a> + +</li> + + </ul> + </nav> + +</li> + + <li class="md-nav__item"> + <a href="#luxcena_neo.neo_behaviour.FloatVariable" class="md-nav__link"> + FloatVariable + </a> + + <nav class="md-nav" aria-label="FloatVariable"> + <ul class="md-nav__list"> + + <li class="md-nav__item"> + <a href="#luxcena_neo.neo_behaviour.FloatVariable.__init__" class="md-nav__link"> + __init__() + </a> + +</li> + + </ul> + </nav> + +</li> + + <li class="md-nav__item"> + <a href="#luxcena_neo.neo_behaviour.BooleanVariable" class="md-nav__link"> + BooleanVariable + </a> + + <nav class="md-nav" aria-label="BooleanVariable"> + <ul class="md-nav__list"> + + <li class="md-nav__item"> + <a href="#luxcena_neo.neo_behaviour.BooleanVariable.__init__" class="md-nav__link"> + __init__() + </a> + +</li> + + </ul> + </nav> + +</li> + + <li class="md-nav__item"> + <a href="#luxcena_neo.neo_behaviour.Trigger" class="md-nav__link"> + Trigger + </a> + + <nav class="md-nav" aria-label="Trigger"> + <ul class="md-nav__list"> + + <li class="md-nav__item"> + <a href="#luxcena_neo.neo_behaviour.Trigger.__init__" class="md-nav__link"> + __init__() + </a> + +</li> + + </ul> + </nav> + +</li> + + </ul> + +</nav> + </div> + </div> + </div> + + + + <div class="md-content" data-md-component="content"> + <article class="md-content__inner md-typeset"> + + + + +<h1 id="documentation-for-neobehaviour">Documentation for <code>NeoBehaviour</code></h1> + + +<div class="doc doc-object doc-class"> + + + +<h2 id="luxcena_neo.neo_behaviour.NeoBehaviour" class="doc doc-heading"> + <code>luxcena_neo.neo_behaviour.NeoBehaviour</code> + + +</h2> + + + <div class="doc doc-contents first"> + + + <p>This is the base-class "main" should inherit from!</p> + +<details class="note"> + <summary>All methods are blocking</summary> + <p>This means that you could potentially loose a "tick"</p> +<p>For example, if "eachSecond" is taking up the thread, and the clock goes from 11:58 to 12:02, "eachHour", will not be called.</p> +</details> +<details class="danger"> + <summary>Do NOT override <strong>init</strong> in your implementation, this will break some features.</summary> + <p>For this purpose you should instead use the <a class="autorefs autorefs-internal" href="#luxcena_neo.neo_behaviour.NeoBehaviour.on_start">on_start</a> method!</p> +</details> <p>Important: An instance of the <a class="autorefs autorefs-internal" href="../Strip/#luxcena_neo.strip.Strip">Strip</a> class will be available in your module as <code>strip</code> without any setup on your part.</p> + + + + + + <div class="doc doc-children"> + + + + + + + + + +<div class="doc doc-object doc-function"> + + + +<h3 id="luxcena_neo.neo_behaviour.NeoBehaviour.declare_variables" class="doc doc-heading"> +<code class="codehilite language-python"><span class="n">declare_variables</span><span class="p">()</span></code> + +</h3> + + + <div class="doc doc-contents "> + + <p>This should be overridden, and ALL variables should be declared here. +When this method is called, variables can be declared using <code>self.declare()</code>.</p> + + </div> + +</div> + +<div class="doc doc-object doc-function"> + + + +<h3 id="luxcena_neo.neo_behaviour.NeoBehaviour.each_day" class="doc doc-heading"> +<code class="codehilite language-python"><span class="n">each_day</span><span class="p">()</span></code> + +</h3> + + + <div class="doc doc-contents "> + + <p>This method is called every day at noon, given that the thread is open</p> + + </div> + +</div> + +<div class="doc doc-object doc-function"> + + + +<h3 id="luxcena_neo.neo_behaviour.NeoBehaviour.each_hour" class="doc doc-heading"> +<code class="codehilite language-python"><span class="n">each_hour</span><span class="p">()</span></code> + +</h3> + + + <div class="doc doc-contents "> + + <p>This method is called every whole hour (on the clock), given that the thread is open</p> + + </div> + +</div> + +<div class="doc doc-object doc-function"> + + + +<h3 id="luxcena_neo.neo_behaviour.NeoBehaviour.each_minute" class="doc doc-heading"> +<code class="codehilite language-python"><span class="n">each_minute</span><span class="p">()</span></code> + +</h3> + + + <div class="doc doc-contents "> + + <p>This method is called every mintue (on the clock), given that the thread is open</p> + + </div> + +</div> + +<div class="doc doc-object doc-function"> + + + +<h3 id="luxcena_neo.neo_behaviour.NeoBehaviour.each_second" class="doc doc-heading"> +<code class="codehilite language-python"><span class="n">each_second</span><span class="p">()</span></code> + +</h3> + + + <div class="doc doc-contents "> + + <p>This method is called every second (on the clock), given that the thread is open</p> + + </div> + +</div> + +<div class="doc doc-object doc-function"> + + + +<h3 id="luxcena_neo.neo_behaviour.NeoBehaviour.each_tick" class="doc doc-heading"> +<code class="codehilite language-python"><span class="n">each_tick</span><span class="p">()</span></code> + +</h3> + + + <div class="doc doc-contents "> + + <p>This method will be run every tick, that means every time the program has time</p> + + </div> + +</div> + +<div class="doc doc-object doc-function"> + + + +<h3 id="luxcena_neo.neo_behaviour.NeoBehaviour.on_start" class="doc doc-heading"> +<code class="codehilite language-python"><span class="n">on_start</span><span class="p">()</span></code> + +</h3> + + + <div class="doc doc-contents "> + + <p>This method will be run right after <strong>init</strong></p> + + </div> + +</div> + + + + </div> + + </div> + +</div><h3 id="an-example-of-the-usage-of-the-class">An example of the usage of the class</h3> +<div class="highlight"><pre><span></span><code><span class="kn">from</span> <span class="nn">luxcena_neo</span> <span class="kn">import</span> <span class="n">NeoBehaviour</span> + +<span class="k">class</span> <span class="nc">Main</span><span class="p">(</span><span class="n">NeoBehaviour</span><span class="p">):</span> + <span class="k">def</span> <span class="nf">on_start</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> + <span class="n">strip</span><span class="o">.</span><span class="n">setPixelColor</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="s2">"#fafafa"</span><span class="p">)</span> +</code></pre></div> +<hr /> + + +<div class="doc doc-object doc-class"> + + + +<h2 id="luxcena_neo.neo_behaviour.Variable" class="doc doc-heading"> + <code>luxcena_neo.neo_behaviour.Variable</code> + + +</h2> + + + <div class="doc doc-contents first"> + + + <p>The base class for any variable, this should <em>probably</em> not be used directly.</p> + + + + + + <div class="doc doc-children"> + + + + + + + +<div class="doc doc-object doc-attribute"> + + + +<h3 id="luxcena_neo.neo_behaviour.Variable.value" class="doc doc-heading"> +<code class="codehilite language-python"><span class="n">value</span></code> + + <span class="doc doc-labels"> + <small class="doc doc-label doc-label-property"><code>property</code></small> + <small class="doc doc-label doc-label-writable"><code>writable</code></small> + </span> + +</h3> + + + <div class="doc doc-contents "> + + <p>This is likely the property you should use to get the current value of the variable.</p> + </div> + +</div> + + + +<div class="doc doc-object doc-function"> + + + +<h3 id="luxcena_neo.neo_behaviour.Variable.__init__" class="doc doc-heading"> +<code class="codehilite language-python"><span class="fm">__init__</span><span class="p">(</span><span class="n">name</span><span class="p">,</span> <span class="n">default</span><span class="p">,</span> <span class="n">var_type</span><span class="p">,</span> <span class="n">on_change</span><span class="o">=</span><span class="kc">None</span><span class="p">)</span></code> + +</h3> + + + <div class="doc doc-contents "> + + <p>The base constructor for any variable. All these parameters should likely be passed on by + the subclass inheriting this one.</p> + + <p><strong>Parameters:</strong></p> + <table> + <thead> + <tr> + <th>Name</th> + <th>Type</th> + <th>Description</th> + <th>Default</th> + </tr> + </thead> + <tbody> + <tr> + <td><code>name</code></td> + <td> + </td> + <td><p>A string which is the name of the variable, keep in mind that this is case sensitive.</p></td> + <td> + <em>required</em> + </td> + </tr> + <tr> + <td><code>default</code></td> + <td> + </td> + <td><p>This will be set as the default value of the variable the first time the script is started.</p></td> + <td> + <em>required</em> + </td> + </tr> + <tr> + <td><code>var_type</code></td> + <td> + <code><span title="luxcena_neo.neo_behaviour.VariableType">VariableType</span></code> + </td> + <td><p>This is the enum number of the variable type, this is just a number which is used to + communicate with the frontend which value picker to show.</p></td> + <td> + <em>required</em> + </td> + </tr> + <tr> + <td><code>on_change</code></td> + <td> + </td> + <td><p>Optional callable, which will be called with the new value every time the variable is + updated (both programatically and via user input).</p></td> + <td> + <code>None</code> + </td> + </tr> + </tbody> + </table> + + </div> + +</div> + + + + </div> + + </div> + +</div><hr /> + + +<div class="doc doc-object doc-class"> + + + +<h2 id="luxcena_neo.neo_behaviour.ColorVariable" class="doc doc-heading"> + <code>luxcena_neo.neo_behaviour.ColorVariable</code> + + +</h2> + + + <div class="doc doc-contents first"> + <p class="doc doc-class-bases"> + Bases: <code><a class="autorefs autorefs-internal" title="luxcena_neo.neo_behaviour.Variable" href="#luxcena_neo.neo_behaviour.Variable">Variable</a></code></p> + + + <p>This is a variable storing a color value. </p> + +<details class="note"> + <summary>Right now, this only properly supports setting the value as a hex string.</summary> + <p>This will hopefully change in the future, but it is likely that the main +operation will remain as hex strings.</p> +</details> + + + + + <div class="doc doc-children"> + + + + + + + + + +<div class="doc doc-object doc-function"> + + + +<h3 id="luxcena_neo.neo_behaviour.ColorVariable.__init__" class="doc doc-heading"> +<code class="codehilite language-python"><span class="fm">__init__</span><span class="p">(</span><span class="n">name</span><span class="p">,</span> <span class="o">*</span><span class="n">color</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span></code> + +</h3> + + + <div class="doc doc-contents "> + + <p>Constructor for a color variable</p> + + <p><strong>Parameters:</strong></p> + <table> + <thead> + <tr> + <th>Name</th> + <th>Type</th> + <th>Description</th> + <th>Default</th> + </tr> + </thead> + <tbody> + <tr> + <td><code>name</code></td> + <td> + <code>str</code> + </td> + <td><p>Will be passed on to the parent class (<a class="autorefs autorefs-internal" href="#luxcena_neo.neo_behaviour.Variable">Variable</a>).</p></td> + <td> + <em>required</em> + </td> + </tr> + <tr> + <td><code>*color</code></td> + <td> + </td> + <td><p>The next positional parameters will be used as the default color. + Right now, it will just pick the first one, and interpret it as a hex color.</p></td> + <td> + <code>()</code> + </td> + </tr> + <tr> + <td><code>**kwargs</code></td> + <td> + </td> + <td><p>Keyword arguments will be passed to the parent class (<a class="autorefs autorefs-internal" href="#luxcena_neo.neo_behaviour.Variable">Variable</a>).</p></td> + <td> + <code>{}</code> + </td> + </tr> + </tbody> + </table> + + </div> + +</div> + + + + </div> + + </div> + +</div><hr /> + + +<div class="doc doc-object doc-class"> + + + +<h2 id="luxcena_neo.neo_behaviour.IntegerVariable" class="doc doc-heading"> + <code>luxcena_neo.neo_behaviour.IntegerVariable</code> + + +</h2> + + + <div class="doc doc-contents first"> + <p class="doc doc-class-bases"> + Bases: <code><a class="autorefs autorefs-internal" title="luxcena_neo.neo_behaviour.Variable" href="#luxcena_neo.neo_behaviour.Variable">Variable</a></code></p> + + + <p>A variable for storing a integer value (whole number).</p> + + + + + + <div class="doc doc-children"> + + + + + + + + + +<div class="doc doc-object doc-function"> + + + +<h3 id="luxcena_neo.neo_behaviour.IntegerVariable.__init__" class="doc doc-heading"> +<code class="codehilite language-python"><span class="fm">__init__</span><span class="p">(</span><span class="n">name</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="n">min_val</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="n">max_val</span><span class="o">=</span><span class="mi">255</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span></code> + +</h3> + + + <div class="doc doc-contents "> + + <p>Constructor for a integer variable</p> + + <p><strong>Parameters:</strong></p> + <table> + <thead> + <tr> + <th>Name</th> + <th>Type</th> + <th>Description</th> + <th>Default</th> + </tr> + </thead> + <tbody> + <tr> + <td><code>name</code></td> + <td> + <code>str</code> + </td> + <td><p>Will be passed on to the parent class (<a class="autorefs autorefs-internal" href="#luxcena_neo.neo_behaviour.Variable">Variable</a>).</p></td> + <td> + <em>required</em> + </td> + </tr> + <tr> + <td><code>default</code></td> + <td> + <code>int</code> + </td> + <td><p>A number which will be set as the default if the mode has never been run before.</p></td> + <td> + <code>0</code> + </td> + </tr> + <tr> + <td><code>min_val</code></td> + <td> + <code>int</code> + </td> + <td><p>The lowest value this variable can have (inclusive).</p></td> + <td> + <code>0</code> + </td> + </tr> + <tr> + <td><code>max_val</code></td> + <td> + <code>int</code> + </td> + <td><p>The highest value this variable can have (inclusive).</p></td> + <td> + <code>255</code> + </td> + </tr> + <tr> + <td><code>**kwargs</code></td> + <td> + </td> + <td><p>Keyword arguments will be passed to the parent class (<a class="autorefs autorefs-internal" href="#luxcena_neo.neo_behaviour.Variable">Variable</a>).</p></td> + <td> + <code>{}</code> + </td> + </tr> + </tbody> + </table> + + </div> + +</div> + + + + </div> + + </div> + +</div><hr /> + + +<div class="doc doc-object doc-class"> + + + +<h2 id="luxcena_neo.neo_behaviour.FloatVariable" class="doc doc-heading"> + <code>luxcena_neo.neo_behaviour.FloatVariable</code> + + +</h2> + + + <div class="doc doc-contents first"> + <p class="doc doc-class-bases"> + Bases: <code><a class="autorefs autorefs-internal" title="luxcena_neo.neo_behaviour.Variable" href="#luxcena_neo.neo_behaviour.Variable">Variable</a></code></p> + + + <p>A variable for storing a float value (decimal number).</p> + + + + + + <div class="doc doc-children"> + + + + + + + + + +<div class="doc doc-object doc-function"> + + + +<h3 id="luxcena_neo.neo_behaviour.FloatVariable.__init__" class="doc doc-heading"> +<code class="codehilite language-python"><span class="fm">__init__</span><span class="p">(</span><span class="n">name</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="mf">0.0</span><span class="p">,</span> <span class="n">min_val</span><span class="o">=</span><span class="mf">0.0</span><span class="p">,</span> <span class="n">max_val</span><span class="o">=</span><span class="mf">255.0</span><span class="p">,</span> <span class="n">step</span><span class="o">=</span><span class="mf">0.5</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span></code> + +</h3> + + + <div class="doc doc-contents "> + + <p>Constructor for a float variable</p> + + <p><strong>Parameters:</strong></p> + <table> + <thead> + <tr> + <th>Name</th> + <th>Type</th> + <th>Description</th> + <th>Default</th> + </tr> + </thead> + <tbody> + <tr> + <td><code>name</code></td> + <td> + <code>str</code> + </td> + <td><p>Will be passed on to the parent class (<a class="autorefs autorefs-internal" href="#luxcena_neo.neo_behaviour.Variable">Variable</a>).</p></td> + <td> + <em>required</em> + </td> + </tr> + <tr> + <td><code>default</code></td> + <td> + <code>float</code> + </td> + <td><p>A number which will be set as the default if the mode has never been run before.</p></td> + <td> + <code>0.0</code> + </td> + </tr> + <tr> + <td><code>min_val</code></td> + <td> + <code>float</code> + </td> + <td><p>The lowest value this variable can have (inclusive).</p></td> + <td> + <code>0.0</code> + </td> + </tr> + <tr> + <td><code>max_val</code></td> + <td> + <code>float</code> + </td> + <td><p>The highest value this variable can have (inclusive).</p></td> + <td> + <code>255.0</code> + </td> + </tr> + <tr> + <td><code>step</code></td> + <td> + <code>float</code> + </td> + <td><p>This does not affect the python code, it only affects the value picker which will be shown in the frontend.</p></td> + <td> + <code>0.5</code> + </td> + </tr> + <tr> + <td><code>**kwargs</code></td> + <td> + </td> + <td><p>Keyword arguments will be passed to the parent class (<a class="autorefs autorefs-internal" href="#luxcena_neo.neo_behaviour.Variable">Variable</a>).</p></td> + <td> + <code>{}</code> + </td> + </tr> + </tbody> + </table> + + </div> + +</div> + + + + </div> + + </div> + +</div><hr /> + + +<div class="doc doc-object doc-class"> + + + +<h2 id="luxcena_neo.neo_behaviour.BooleanVariable" class="doc doc-heading"> + <code>luxcena_neo.neo_behaviour.BooleanVariable</code> + + +</h2> + + + <div class="doc doc-contents first"> + <p class="doc doc-class-bases"> + Bases: <code><a class="autorefs autorefs-internal" title="luxcena_neo.neo_behaviour.Variable" href="#luxcena_neo.neo_behaviour.Variable">Variable</a></code></p> + + + <p>A variable for storing a boolean value (on/off).</p> + + + + + + <div class="doc doc-children"> + + + + + + + + + +<div class="doc doc-object doc-function"> + + + +<h3 id="luxcena_neo.neo_behaviour.BooleanVariable.__init__" class="doc doc-heading"> +<code class="codehilite language-python"><span class="fm">__init__</span><span class="p">(</span><span class="n">name</span><span class="p">,</span> <span class="n">default</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span></code> + +</h3> + + + <div class="doc doc-contents "> + + <p>Constructor for a boolean variable</p> + + <p><strong>Parameters:</strong></p> + <table> + <thead> + <tr> + <th>Name</th> + <th>Type</th> + <th>Description</th> + <th>Default</th> + </tr> + </thead> + <tbody> + <tr> + <td><code>name</code></td> + <td> + <code>str</code> + </td> + <td><p>Will be passed on to the parent class (<a class="autorefs autorefs-internal" href="#luxcena_neo.neo_behaviour.Variable">Variable</a>).</p></td> + <td> + <em>required</em> + </td> + </tr> + <tr> + <td><code>default</code></td> + <td> + <code>bool</code> + </td> + <td><p>A boolean which will be set as the default if the mode has never been run before.</p></td> + <td> + <em>required</em> + </td> + </tr> + <tr> + <td><code>**kwargs</code></td> + <td> + </td> + <td><p>Keyword arguments will be passed to the parent class (<a class="autorefs autorefs-internal" href="#luxcena_neo.neo_behaviour.Variable">Variable</a>).</p></td> + <td> + <code>{}</code> + </td> + </tr> + </tbody> + </table> + + </div> + +</div> + + + + </div> + + </div> + +</div><hr /> + + +<div class="doc doc-object doc-class"> + + + +<h2 id="luxcena_neo.neo_behaviour.Trigger" class="doc doc-heading"> + <code>luxcena_neo.neo_behaviour.Trigger</code> + + +</h2> + + + <div class="doc doc-contents first"> + <p class="doc doc-class-bases"> + Bases: <code><a class="autorefs autorefs-internal" title="luxcena_neo.neo_behaviour.Variable" href="#luxcena_neo.neo_behaviour.Variable">Variable</a></code></p> + + + <p>A trigger which can execute some function.</p> +<p>Although technically a variable, this is not intended as one. +It is intended to be used with a on_change function, such that +this action is performed when this trigger is activated.</p> +<p>It will show up as a button in the frontend, and can also be triggered by +setting the value (What you set it as will be ignored, so e.g. None.</p> + + + + + + <div class="doc doc-children"> + + + + + + + + + +<div class="doc doc-object doc-function"> + + + +<h3 id="luxcena_neo.neo_behaviour.Trigger.__init__" class="doc doc-heading"> +<code class="codehilite language-python"><span class="fm">__init__</span><span class="p">(</span><span class="n">name</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span></code> + +</h3> + + + <div class="doc doc-contents "> + + <p>Constructor for the Trigger +It is important to set the on_change callable (see the Variable class). If you don't +this class is completely useless.</p> + + <p><strong>Parameters:</strong></p> + <table> + <thead> + <tr> + <th>Name</th> + <th>Type</th> + <th>Description</th> + <th>Default</th> + </tr> + </thead> + <tbody> + <tr> + <td><code>name</code></td> + <td> + <code>str</code> + </td> + <td><p>The name of the trigger variable (mostly useful if you wanted to trigger it in the code).</p></td> + <td> + <em>required</em> + </td> + </tr> + <tr> + <td><code>**kwargs</code></td> + <td> + </td> + <td><p>Keyword arguments will be passed to the parent class (<a class="autorefs autorefs-internal" href="#luxcena_neo.neo_behaviour.Variable">Variable</a>).</p></td> + <td> + <code>{}</code> + </td> + </tr> + </tbody> + </table> + + </div> + +</div> + + + + </div> + + </div> + +</div> + + + + + + + </article> + </div> + + + </div> + + </main> + + <footer class="md-footer"> + + + <nav class="md-footer__inner md-grid" aria-label="Footer" > + + + <a href="../Strip/" class="md-footer__link md-footer__link--prev" aria-label="Previous: Strip" rel="prev"> + <div class="md-footer__button md-icon"> + <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12Z"/></svg> + </div> + <div class="md-footer__title"> + <div class="md-ellipsis"> + <span class="md-footer__direction"> + Previous + </span> + Strip + </div> + </div> + </a> + + + + <a href="../../Code%20Documentation/Run/" class="md-footer__link md-footer__link--next" aria-label="Next: Run" rel="next"> + <div class="md-footer__title"> + <div class="md-ellipsis"> + <span class="md-footer__direction"> + Next + </span> + Run + </div> + </div> + <div class="md-footer__button md-icon"> + <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4 11v2h12l-5.5 5.5 1.42 1.42L19.84 12l-7.92-7.92L10.5 5.5 16 11H4Z"/></svg> + </div> + </a> + + </nav> + + <div class="md-footer-meta md-typeset"> + <div class="md-footer-meta__inner md-grid"> + <div class="md-copyright"> + + + Made with + <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener"> + Material for MkDocs + </a> + +</div> + + </div> + </div> +</footer> + + </div> + <div class="md-dialog" data-md-component="dialog"> + <div class="md-dialog__inner md-typeset"></div> + </div> + + <script id="__config" type="application/json">{"base": "../..", "features": [], "search": "../../assets/javascripts/workers/search.16e2a7d4.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.config.lang": "en", "search.config.pipeline": "trimmer, stopWordFilter", "search.config.separator": "[\\s\\-]+", "search.placeholder": "Search", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version.title": "Select version"}}</script> + + + <script src="../../assets/javascripts/bundle.5a2dcb6a.min.js"></script> + + <script src="../../assets/luxcena-colors.js"></script> + + <script src="../../assets/webfont.js"></script> + + <script src="../../assets/snap.svg-min.js"></script> + + <script src="../../assets/underscore-min.js"></script> + + <script src="../../assets/sequence-diagram.min.js"></script> + + <script src="../../assets/js-sequence.js"></script> + + + + </body> +</html>
\ No newline at end of file |