-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create a service for NKT fianium #290
base: develop
Are you sure you want to change the base?
Conversation
I feel like combining the Fanium with the current catkit2/catkit2/services/nkt_superk/nkt_superk.py Lines 235 to 237 in e3f5912
etc... But you can do the same in the def __init__(self, ...):
... # Other setup code.
connected_device = self.config['connected_device'].lower()
if connected_device == 'evo':
device = Evo
elif connected_device == 'fanium':
device = Fanium
else:
raise NotImplementedError(f'Connected device {connected_device} not implemented.')
# Common functions between Evo and Fanium.
self.get_emission = read_register(registerReadU8, device.REG_EMISSION, ratio=0.5)
self.get_emission = read_register(registerReadU8, device.REG_EMISSION, ratio=0.5)
if device is Evo:
self.get_base_temperature = read_register(registerReadS16, Evo.REG_BASE_TEMPERATURE, ratio=0.1)
if device is Fanium:
... # Fanium specific functions. Does that work for you? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great so far! Left some comments for further steps. We can go through how to work through failed CI tests and how to adapt the simulated service later.
#REG_BASE_TEMPERATURE = 0x17 | ||
#REG_SUPPLY_VOLTAGE = 0x1D | ||
#REG_EXTERNAL_CONTROL_INPUT = 0x94 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you have double-checked that the Fianium doesn't have any of these, delete them all. Together with the "added" comments, since that is obvious from the code.
} | ||
|
||
if self.device is Evo: | ||
funcs['current_setpoint'] = self.monitor_func(self.current_setpoint, self.set_current_setpoint) | ||
funcs['evo_status'] = self.update_func(self.update_evo_status) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am pretty sure we'll need an update function for the Fianium as well. For that you will need to check what you can read from it with some sort of "get" functions I suppose, similar to the Evo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't forget to delete this file!
This PR aims to setup a service for Fianium + Varia config.
Todo: