This repository was archived by the owner on Nov 23, 2025. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,6 +8,9 @@ Version 0.4.0
88 this is for hash-ability. This change was required for 3.11
99 support due to the
1010 `dataclass changes <https://github.com/python/cpython/issues/88840 >`_.
11+ * Device definitions are shifted into private modules within a
12+ devices packages. The intended API avoids having to be aware of this
13+ complexity.
1114
1215Version 0.3.0
1316-------------
Original file line number Diff line number Diff line change @@ -247,7 +247,6 @@ class Device:
247247 """Define an implemented UOS device dictionary."""
248248
249249 name : str
250- versions : dict
251250 interfaces : list
252251 functions_enabled : dict
253252 digital_pins : dict = field (default_factory = dict )
Original file line number Diff line number Diff line change 1+ """Packages used to define Devices supported by the library."""
2+ from dataclasses import dataclass
3+
4+ from uoshardware .abstractions import Device
5+ from uoshardware .devices ._arduino import _ARDUINO_NANO_3
6+
7+
8+ @dataclass (init = False , repr = False , frozen = True )
9+ class Devices :
10+ """Names for supported hardware linking to the Device object used.
11+
12+ :cvar hwid_0: device: _ARDUINO_NANO_3
13+ :cvar arduino_nano: device: _ARDUINO_NANO_3
14+ :cvar arduino_uno: device: _ARDUINO_NANO_3
15+ """
16+
17+ # Lookup constants linking devices to importable names
18+ hwid_0 : Device = _ARDUINO_NANO_3
19+ arduino_nano : Device = _ARDUINO_NANO_3
20+ arduino_uno : Device = _ARDUINO_NANO_3
Original file line number Diff line number Diff line change 1- """Module defining supported hardware definitions."""
2- from dataclasses import dataclass
3-
1+ """Module contains definitions for arduino devices."""
42from uoshardware import Persistence
53from uoshardware .abstractions import Device , Pin , UOSFunctions
64from uoshardware .interface import Interface
75
86_ARDUINO_NANO_3 = Device (
97 name = "Arduino Nano 3" ,
10- versions = {},
118 interfaces = [Interface .STUB , Interface .SERIAL ],
129 functions_enabled = {
1310 UOSFunctions .set_gpio_output .name : [Persistence .NONE ],
109106 },
110107 aux_params = {"default_baudrate" : 115200 },
111108)
112-
113-
114- @dataclass (init = False , repr = False , frozen = True )
115- class Devices :
116- """Names for supported hardware linking to the Device object used.
117-
118- :cvar hwid_0: device: _ARDUINO_NANO_3
119- :cvar arduino_nano: device: _ARDUINO_NANO_3
120- :cvar arduino_uno: device: _ARDUINO_NANO_3
121- """
122-
123- # Lookup constants linking devices to importable names
124- hwid_0 : Device = _ARDUINO_NANO_3
125- arduino_nano : Device = _ARDUINO_NANO_3
126- arduino_uno : Device = _ARDUINO_NANO_3
You can’t perform that action at this time.
0 commit comments