Changeset - 2b8a2a25b154
[Not reviewed]
default
0 3 0
drewp@bigasterisk.com - 20 months ago 2023-05-28 00:56:28
drewp@bigasterisk.com
logging
3 files changed with 3 insertions and 2 deletions:
0 comments (0 inline, 0 general)
light9/collector/collector.py
Show inline comments
 
@@ -64,24 +64,25 @@ class Collector:
 
        self._deviceType: Dict[DeviceUri, DeviceClass] = {}
 
        self.remapOut: Dict[Tuple[DeviceUri, OutputAttr], OutputRange] = {}
 

	
 
        self.graph.addHandler(self._compile)
 

	
 
        # rename to activeSessons ?
 
        self.lastRequest: Dict[Tuple[ClientType, ClientSessionType], Tuple[UnixTime, Dict[Tuple[DeviceUri, DeviceAttr], VTUnion]]] = {}
 

	
 
        # (dev, devAttr): value to use instead of 0
 
        self.stickyAttrs: Dict[Tuple[DeviceUri, DeviceAttr], VTUnion] = {}
 

	
 
    def _compile(self):
 
        log.info('Collector._compile:')
 
        self._outputByUri = self._compileOutputByUri()
 
        self._outputMap = _outputMap(self.graph, set(self._outputByUri.keys()))
 

	
 
        self._deviceType.clear()
 
        self.remapOut.clear()
 
        for dc in self.graph.subjects(RDF.type, L9['DeviceClass']):
 
            dc = cast(DeviceClass, dc)
 
            for dev in self.graph.subjects(RDF.type, dc):
 
                dev = cast(DeviceUri, dev)
 
                self._deviceType[dev] = dc
 
                self._compileRemapForDevice(dev)
 

	
light9/live/Light9AttrControl.ts
Show inline comments
 
@@ -128,25 +128,25 @@ export class Light9AttrControl extends L
 
    } else if (d.equals(makeType("color"))) {
 
      this.dataType = "color";
 
    } else if (d.equals(makeType("choice"))) {
 
      this.dataType = "choice";
 
    }
 
  }
 

	
 
  onValueInput(ev: CustomEvent) {
 
    if (ev.detail === undefined) {
 
      // not sure what this is, but it seems to be followed by good events
 
      return;
 
    }
 
    log(ev.type, ev.detail.value);
 
    // log(ev.type, ev.detail.value);
 
    this.value = ev.detail.value;
 
    // this.graphToControls.controlChanged(this.device, this.deviceAttrRow.uri, ev.detail.value);
 
  }
 

	
 
  onGraphValueChanged(v: ControlValue | null) {
 
    if (this.deviceAttrRow === null) throw new Error();
 
    // log("change: control must display", v, "for", this.deviceAttrRow.device.value, this.deviceAttrRow.uri.value);
 
    // this.enableChange = false;
 
    if (this.dataType == "scalar") {
 
      if (v !== null) {
 
        this.value = v;
 
      } else {
light9/rdfdb/service.py
Show inline comments
 
@@ -2,25 +2,25 @@ import logging
 
import os
 
from pathlib import Path
 

	
 
from light9.run_local import log
 

	
 
import rdfdb.service
 
from rdflib import URIRef
 

	
 
from light9 import showconfig
 
logging.getLogger('rdfdb').setLevel(logging.INFO)
 
logging.getLogger('rdfdb.file').setLevel(logging.INFO)
 
logging.getLogger('rdfdb.graph').setLevel(logging.INFO)
 
logging.getLogger('rdfdb.net').setLevel(logging.DEBUG)
 
logging.getLogger('rdfdb.net').setLevel(logging.INFO)
 
rdfRoot = Path(os.environ['LIGHT9_SHOW'].rstrip('/') + '/')
 
showUri = URIRef(showconfig.showUri() + '/')
 

	
 
app = rdfdb.service.makeApp(  #
 
    dirUriMap={rdfRoot: showUri},
 
    prefixes={
 
        'show': showUri,
 
        '': URIRef('http://light9.bigasterisk.com/'),
 
        'rdf': URIRef('http://www.w3.org/1999/02/22-rdf-syntax-ns#'),
 
        'rdfs': URIRef('http://www.w3.org/2000/01/rdf-schema#'),
 
        'xsd': URIRef('http://www.w3.org/2001/XMLSchema#'),
 
        'effect': URIRef('http://light9.bigasterisk.com/effect/'),
0 comments (0 inline, 0 general)