-
Notifications
You must be signed in to change notification settings - Fork 36
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
Is it possible to change channel's names through the API? #50
Comments
If you can do it in the app then there's an API call for it. I don't think that's exposed in this library yet since this is mostly intended for reading out data and turning things on and off, management of that sort of info seems manual enough that I figured you'd do it in the app. May I ask what your use case is that you want to change the names through the API? |
I've been looking for the API call for it for some time now and I thought I should ask. I'd like to have pre-set names for it and do it via a script instead of accessing the webpage. |
v0.17.0 which I just released has a method import pyemvue
vue = pyemvue.PyEmVue()
vue.login( token_storage_file='keys.json')
devices = vue.get_devices()
# find the device with gid 1234 and the channel with channel_num 8
device = next((d for d in devices if d.device_gid == 1234), None)
channel = next((c for c in device.channels if c.channel_num == '8'), None)
# change the name to the current time
channel.name = datetime.now().strftime('%H:%M:%S')
# update the channel
channel = vue.update_channel(channel) |
Perfect! vue.update_channel works. Thank you! Would the renaming of the name of the monitor, multiplier and nesting under other devices be relatively easy to implement as well? |
I can look into those other endpoints too but that might not be something I can get to tonight. The multiplier should already be on the channel so that should just work with that new method. Changing the device name and how it's nested will likely be a separate call but seems like it shouldn't be difficult assuming it's just a PUT with the whole object like the channel was. |
Sounds good, thank you! |
I see the multiplier in the channel info, but it seems to be wrong. It is always showing as 1.0 for me. |
No description provided.
The text was updated successfully, but these errors were encountered: