From cc6e1a5f3ec83510773977cf1b7b4184ea865ee5 Mon Sep 17 00:00:00 2001 From: Helmut Merz Date: Thu, 20 Jun 2013 13:33:43 +0200 Subject: [PATCH] provide unified access to state icon (or colored led) --- stateful/definition.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/stateful/definition.py b/stateful/definition.py index 1c3d8c6..cee7063 100644 --- a/stateful/definition.py +++ b/stateful/definition.py @@ -43,6 +43,10 @@ class State(object): for k, v in kw.items(): setattr(self, k, v) + @property + def stateIcon(self): + return 'cybertools.icons/' + (self.icon or 'led%s.png' % self.color) + class Action(object):