Skip to content

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

@petrklus

Description

@petrklus

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions