Skip to content
Snippets Groups Projects
Commit 3d88d282 authored by jkerdreu's avatar jkerdreu
Browse files

Added support for is_ready() on device. This still need some works in some...

Added support for is_ready() on device. This still need some works in some cases for devices without attributes.. but this does the tricks right now

git-svn-id: https://redmine.imt-atlantique.fr/svn/xaal/code/Python/branches/0.7@2984 b32b6428-25c9-4566-ad07-03861ab6144f
parent f4f5bcd5
No related branches found
No related tags found
No related merge requests found
......@@ -39,6 +39,9 @@ class TimedDict(dict):
self.updated()
return changed
def is_ready(self):
return True if (self.last_update != 0) else False
class Device:
def __init__(self, addr, dev_type):
......@@ -79,6 +82,12 @@ class Device:
self.db.pop(k)
return r
def is_ready(self):
if self.attributes.is_ready() and self.description.is_ready():
#if self.description.is_ready():
return True
return False
def alive(self,value):
self.last_alive = int(time.time())
self.next_alive = self.last_alive + value
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment