Skip to content

Commit

Permalink
stateengine plugin: improve error handling when laststate items, etc.…
Browse files Browse the repository at this point in the history
… are not defined
  • Loading branch information
onkelandy committed Aug 16, 2023
1 parent 8904332 commit 3e5fb92
Showing 1 changed file with 20 additions and 10 deletions.
30 changes: 20 additions & 10 deletions stateengine/StateEngineItem.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,43 +96,53 @@ def instant_leaveaction(self):

@property
def laststate(self):
return self.__laststate_item_id.property.value
_returnvalue = None if self.__laststate_item_id is None else self.__laststate_item_id.property.value
return _returnvalue

@property
def previousstate(self):
return self.__previousstate_item_id.property.value
_returnvalue = None if self.__previousstate_item_id is None else self.__previousstate_item_id.property.value
return _returnvalue

@property
def lastconditionset(self):
return self.__lastconditionset_item_id.property.value
_returnvalue = None if self.__lastconditionset_item_id is None else self.__lastconditionset_item_id.property.value
return _returnvalue

@property
def previousconditionset(self):
return self.__previousconditionset_item_id.property.value
_returnvalue = None if self.__previousconditionset_item_id is None else self.__previousconditionset_item_id.property.value
return _returnvalue

@property
def previousstate_conditionset(self):
return self.__previousstate_conditionset_item_id.property.value
_returnvalue = None if self.__previousstate_conditionset_item_id is None else self.__previousstate_conditionset_item_id.property.value
return _returnvalue

@property
def laststate_name(self):
return self.__laststate_item_name.property.value
_returnvalue = None if self.__laststate_item_name is None else self.__laststate_item_name.property.value
return _returnvalue

@property
def previousstate_name(self):
return self.__previousstate_item_name.property.value
_returnvalue = None if self.__previousstate_item_name is None else self.__previousstate_item_name.property.value
return _returnvalue

@property
def lastconditionset_name(self):
return self.__lastconditionset_item_name.property.value
_returnvalue = None if self.__lastconditionset_item_name is None else self.__lastconditionset_item_name.property.value
return _returnvalue

@property
def previousconditionset_name(self):
return self.__previousconditionset_item_name.property.value
_returnvalue = None if self.__previousconditionset_item_name is None else self.__previousconditionset_item_name.property.value
return _returnvalue

@property
def previousstate_conditionset_name(self):
return self.__previousstate_conditionset_item_name.property.value
_returnvalue = None if self.__previousstate_conditionset_item_name is None else self.__previousstate_conditionset_item_name.property.value
return _returnvalue

@property
def ab_alive(self):
Expand Down

0 comments on commit 3e5fb92

Please sign in to comment.