petervizi/python-eeml

reading ID can be a string (at least on cosm.com)

Opened this issue · 1 comments

Hi,
First of all - thank for your excellent library!

I am using it to publish some temperatures from my home automation system, however, I had to resort to a rather dirty hack to enable string in identifiers:

pac = eeml.datastream.Cosm(API_URL, API_KEY)

fridge_temp = eeml.Data(0, 4.2, unit=eeml.unit.Celsius())
fridge_temp._id = "fridge_temp" #overriding the check for integer

freezer_temp = eeml.Data(0, -22.2, unit=eeml.unit.Celsius())
freezer_temp._id = "freezer_temp"
pac.update([fridge_temp])
pac.update([freezer_temp])
pac.put()

As I like things robust, I would prefer it it all worked even after you update and change some of the internals...

Here is an example of my aforementioned setup, where all works as it should!
image

Hey petrklus, please refer to issue #24 for a detailed discussion, and the test_invalidator test case in tests/test_eeml.py on how to use the Invalidator.