Mercurial > code > home > repos > homeauto
comparison service/piNode/devices.py @ 1136:1e43ec4a5f23
build and import updates for rdfdb, etc
Ignore-this: 233cb2b31f03be51695f0fff40eecca7
darcs-hash:92c1c526292f9013ad41d2e3b6d11add8fff02ae
author | drewp <drewp@bigasterisk.com> |
---|---|
date | Mon, 19 Feb 2018 04:21:28 -0800 |
parents | 7375eae3e095 |
children | f64e20d3407e |
comparison
equal
deleted
inserted
replaced
1135:b9c6b8724d43 | 1136:1e43ec4a5f23 |
---|---|
4 from __future__ import division | 4 from __future__ import division |
5 | 5 |
6 import time, logging, os | 6 import time, logging, os |
7 from rdflib import Namespace, URIRef, Literal | 7 from rdflib import Namespace, URIRef, Literal |
8 from twisted.internet import reactor | 8 from twisted.internet import reactor |
9 | |
10 from devices_shared import RgbPixelsAnimation | |
11 | |
12 log = logging.getLogger() | |
13 ROOM = Namespace('http://projects.bigasterisk.com/room/') | |
14 XSD = Namespace('http://www.w3.org/2001/XMLSchema#') | |
15 RDFS = Namespace('http://www.w3.org/2000/01/rdf-schema#') | |
9 | 16 |
10 try: | 17 try: |
11 import pigpio | 18 import pigpio |
12 except ImportError: | 19 except ImportError: |
13 pigpio = None | 20 pigpio = None |
21 actual = pi.set_PWM_frequency(pinNumber, hz) | 28 actual = pi.set_PWM_frequency(pinNumber, hz) |
22 if actual != hz: | 29 if actual != hz: |
23 raise ValueError('pwm actual=%s' % actual) | 30 raise ValueError('pwm actual=%s' % actual) |
24 pi.set_PWM_dutycycle(pinNumber, 0) | 31 pi.set_PWM_dutycycle(pinNumber, 0) |
25 | 32 |
26 import sys | |
27 | |
28 log = logging.getLogger() | |
29 ROOM = Namespace('http://projects.bigasterisk.com/room/') | |
30 XSD = Namespace('http://www.w3.org/2001/XMLSchema#') | |
31 RDFS = Namespace('http://www.w3.org/2000/01/rdf-schema#') | |
32 | 33 |
33 class DeviceType(object): | 34 class DeviceType(object): |
34 deviceType = NotImplementedError | 35 deviceType = NotImplementedError |
35 @classmethod | 36 @classmethod |
36 def findInstances(cls, graph, board, pi): | 37 def findInstances(cls, graph, board, pi): |