mirror of
https://github.com/KevinMidboe/python-gpiozero.git
synced 2025-10-29 17:50:37 +00:00
This finishes off implementing values and source for all (current) classes in gpiozero. I'm afraid things get rather complex in this commit. For starters, we've now got quite a few "aggregate" classes which necessarily don't descend from GPIODevice. To implement values and source on these I could either repeat a helluva lot of code or ... turn to mixin classes. Yeah, it's multiple inheritance time, baby! Unfortunately multiple inheritance doesn't work with __slots__ but we really ought to keep functionality that they provide us (raise AttributeError when an unknown attribute is set). So I've implemented this with ... erm ... metaclasses. Sorry!
44 lines
677 B
Python
44 lines
677 B
Python
from __future__ import (
|
|
unicode_literals,
|
|
print_function,
|
|
absolute_import,
|
|
division,
|
|
)
|
|
|
|
from .devices import (
|
|
GPIODeviceClosed,
|
|
GPIODeviceError,
|
|
GPIODevice,
|
|
)
|
|
from .input_devices import (
|
|
InputDeviceError,
|
|
InputDevice,
|
|
Button,
|
|
MotionSensor,
|
|
LightSensor,
|
|
TemperatureSensor,
|
|
AnalogInputDevice,
|
|
MCP3008,
|
|
MCP3004,
|
|
)
|
|
from .output_devices import (
|
|
OutputDeviceError,
|
|
OutputDevice,
|
|
PWMOutputDevice,
|
|
PWMLED,
|
|
LED,
|
|
Buzzer,
|
|
Motor,
|
|
RGBLED,
|
|
)
|
|
from .boards import (
|
|
LEDBoard,
|
|
PiLiter,
|
|
TrafficLights,
|
|
PiTraffic,
|
|
FishDish,
|
|
TrafficHat,
|
|
Robot,
|
|
RyanteckRobot,
|
|
)
|