In [ ]:
from opengrid.library import houseprint
So you want to create your own Houseprint object which you can save to a file and share with your project partners? Follow this guide:
In [ ]:
# use the `empty_init` flag to create an empty object
hp = houseprint.Houseprint(empty_init=True)
In [ ]:
hp
There is a strong hierarchy, which you must follow!
In [ ]:
site1 = houseprint.Site(key="Your house name")
In [ ]:
# consult the docs to see what fields are available!
# houseprint.Site??
# houseprint.Fluksometer??
# houseprint.Fluksosensor??
In [ ]:
device1 = houseprint.Fluksometer(key='fluksoname')
In [ ]:
sensor1 = houseprint.Fluksosensor(key='keykeykey', token="blabla", type='electricity')
In [ ]:
device1.add_sensor(sensor1)
In [ ]:
site1.add_device(device1)
In [ ]:
hp.add_site(site1)
In [ ]:
hp
In [ ]:
hp.save('sharable_houseprint.pkl')
Share this file with your friends!
In [ ]:
hp2 = houseprint.load_houseprint_from_file('sharable_houseprint.pkl')
In [ ]:
hp2
In [ ]:
hp2.init_tmpo()
In [ ]:
hp2.get_data()
In [ ]: