Skip to content

Commit cadc80d

Browse files
committed
Expose more internal thermocouple classes via type aliases
1 parent 7f341ca commit cadc80d

3 files changed

Lines changed: 10 additions & 1 deletion

File tree

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,11 @@ Some design choices of the original Tinkerforge API are overly complex. I theref
159159
- `BrickletPtcV2()` takes an additional parameter to define the type of sensor. The options are `BrickletPtc.SensorType.PT_100` and `BrickletPtc.SensorType.PT_1000`. This only determines the resistance returned by the bricklet. The default is `BrickletPtc.SensorType.PT_100`.
160160
- `BrickletPtcV2.sensor_type` getter and setter to change the type of sensor used.
161161

162+
- ### [Thermocouple Bricklet 2.0](https://www.tinkerforge.com/en/doc/Hardware/Bricklets/Thermocouple_V2.html)
163+
- `BrickletThermocoupleV2()` takes an additional parameter to define the type of sensor. The options are of type `BrickletThermocoupleV2.SensorType`. The default is `BrickletPtc.SensorType.TYPE_K`.
164+
- `BrickletThermocoupleV2.sensor_type` getter and setter to change the type of sensor used.
165+
166+
162167
- ### [Segment Display 4x7 Bricklet 2.0](https://www.tinkerforge.com/en/doc/Hardware/Bricklets/Segment_Display_4x7_V2.html)
163168
- `BrickletSegmentDisplay4x7V2.set_segments()` takes a `list`/`tuple` of 4 `int` instead of digit0, digit1, digit2, digit3. This is the same API as the older [Segment Display 4x7 Bricklet](https://www.tinkerforge.com/en/doc/Hardware/Bricklets/Segment_Display_4x7.html).
164169

examples/bricklet_thermocouple_v2.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ async def run_example(bricklet: BrickletThermocoupleV2) -> None:
5050
try:
5151
print("Identity:", await bricklet.get_identity())
5252

53+
# Query the config
54+
print("Bricklet config:", await bricklet.get_configuration())
55+
5356
# Query the value
5457
print("Get temperature:", await bricklet.get_temperature())
5558
print("Set callback period to", 1000, "ms")

tinkerforge_async/bricklet_thermocouple_v2.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,9 @@ class BrickletThermocoupleV2(BrickletWithMCU):
131131
CallbackID = CallbackID
132132
FunctionID = FunctionID
133133
ThresholdOption = Threshold
134+
Averaging = Averaging
134135
SensorType = SensorType
136+
LineFilter = LineFilter
135137

136138
CALLBACK_FORMATS = {CallbackID.TEMPERATURE: "i", CallbackID.ERROR_STATE: "! !"}
137139

@@ -346,7 +348,6 @@ async def get_configuration(self) -> GetConfiguration:
346348
)
347349

348350
averaging, sensor_type, line_filter = unpack_payload(payload, "B B B")
349-
self.__sensor_type = sensor_type
350351
return GetConfiguration(Averaging(averaging), SensorType(sensor_type), LineFilter(line_filter))
351352

352353
async def get_error_state(self) -> GetErrorState:

0 commit comments

Comments
 (0)