domschl / python-fhem

Python FHEM (home automation server) API
MIT License
15 stars 6 forks source link

added get_dev_reading_time to read the timestamp of a reading #5

Closed logi85 closed 6 years ago

logi85 commented 7 years ago

Hi,

think this could be also nice for someone else.

domschl commented 7 years ago

Thanks for this! What do you think about returning a time value instead of a string?

logi85 commented 7 years ago

You're welcome!

good idea, I use the method this way, perhaps you want do add the strptime?:

def get_last_rssi(reading): rssi = fh.get_dev_reading_time("MAX_165836", "RSSI") return datetime.strptime(rssi, '%Y-%m-%d %H:%M:%S')

best regards logi85

domschl commented 6 years ago

I've manually merged this into testing, will be part of the next version. Tx!

domschl commented 6 years ago

Now on pypi as fhem 0.5.0