From 7e0d85acc735e7f91b0dc4c5a0f0f2784e23ebd0 Mon Sep 17 00:00:00 2001 From: Dominik Roth Date: Thu, 10 Oct 2024 17:14:26 +0200 Subject: [PATCH] Update README --- README.md | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0b16b35..193d0c3 100644 --- a/README.md +++ b/README.md @@ -41,14 +41,23 @@ nucon.set_dummy_mode(True) # Read a parameter core_temp = nucon.CORE_TEMP.value print(f"Core Temperature: {core_temp}") +# >> Core Temperature: 500.0 # Read a parameter with an enum type pump_status = nucon.COOLANT_CORE_CIRCULATION_PUMP_0_STATUS.value print(f"Pump 0 Status: {pump_status}") +if nucon.COOLANT_CORE_CIRCULATION_PUMP_0_STATUS.value: + print('Pump 0 is active.') +# >> Pump 0 Status: PumpStatus.INACTIVE -# Write to a parameter +# Write to a parameter (has no effect in dummy mode) nucon.RODS_POS_ORDERED.value = 50 print(f"Rods Position Ordered: {nucon.RODS_POS_ORDERED.value}") +# >> Rods Position Ordered: 50.0 + +# The repr of an attribute contains all contained info +nucon.CORE_TEMP +# >> NuconParameter(id='CORE_TEMP', value=500.0, param_type=float, writable=False) ``` ## API Reference @@ -74,7 +83,7 @@ Class methods: - `nucon.get_all_iter()`: Get all parameter values as a dictionary as a generator - `nucon.get_multiple(params)`: Get values for multiple specified parameters - `nucon.get_multiple_iter(params)`: Get values for multiple specified parameters as a generator -- `nucon.set_dummy_mode(dummy_mode)`: Enable or disable dummy mode for testing +- `nucon.set_dummy_mode(dummy_mode)`: Enable or disable dummy mode for testing. In dummy mode we won't connect to the game and just return sensible values for all params and allow but ignore all writes to writable parameters. Custom Enum Types: - `PumpStatus`: Enum for pump status (INACTIVE, ACTIVE_NO_SPEED_REACHED\*, ACTIVE_SPEED_REACHED\*, REQUIRES_MAINTENANCE, NOT_INSTALLED, INSUFFICIENT_ENERGY)