Update README

This commit is contained in:
Dominik Moritz Roth 2024-10-10 17:14:26 +02:00
parent 878fb9cf4f
commit 7e0d85acc7

View File

@ -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)