I'm a new user of skyspark and we're interested in integrating our campus' sites and historical data through the REST API or by using the pyhaystack library if that supports what we're trying to accomplish.
So far I've been successful in connecting to my server with the pyhaystack client and been able to read tags with operations like op = session.find_entity(filter_expr='temp')
All is fine and well, except when I want to modify the tag list:
t1.tags['faketag1'] = None
Traceback (most recent call last):
File "<ipython-input-27-4eb0de79124a>", line 1, in <module>
t1.tags['faketag1'] = None
TypeError: 'ReadOnlyEntityTags' object does not support item assignment
Is there a setting in my skyspark server or the pyhaystack client that is ensuring that all of my tags are of type "ReadOnlyEntityTags" and not "MutableEntityTags"
This is the section of the pyhaystack documentation I was following along with. https://pyhaystack.readthedocs.io/en/latest/tags.html#adding-changing-and-deleting-tags
Thanks!
Carlos RiveraMon 3 Jun 2019
Hi, the documentation you linked to also says:
Having done this, it is possible to interrogate the tags attached to this entity. These are accessed by the tags property, which also returns a pyhaystack.client.entity.tags.MutableEntityTags if your server supports making changes via the Project Haystack API (currently only WideSky), or pyhaystack.client.entity.tags.ReadOnlyEntityTags otherwise.
Maybe you can follow pyhaystack code and see at which point one class or another is chosen. Good luck!
correy koshnick Wed 29 May 2019
Hello,
I'm a new user of skyspark and we're interested in integrating our campus' sites and historical data through the REST API or by using the pyhaystack library if that supports what we're trying to accomplish.
So far I've been successful in connecting to my server with the pyhaystack client and been able to read tags with operations like op = session.find_entity(filter_expr='temp')
an example sensor looks like this:
All is fine and well, except when I want to modify the tag list:
t1.tags['faketag1'] = None
Is there a setting in my skyspark server or the pyhaystack client that is ensuring that all of my tags are of type "ReadOnlyEntityTags" and not "MutableEntityTags"
This is the section of the pyhaystack documentation I was following along with. https://pyhaystack.readthedocs.io/en/latest/tags.html#adding-changing-and-deleting-tags
Thanks!
Carlos Rivera Mon 3 Jun 2019
Hi, the documentation you linked to also says:
Maybe you can follow pyhaystack code and see at which point one class or another is chosen. Good luck!