Skip to content

Commit

Permalink
fix if actor plugin is not installed and actor is still in config
Browse files Browse the repository at this point in the history
  • Loading branch information
avollkopf committed Dec 17, 2024
1 parent 5d66521 commit aa55033
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cbpi/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
__version__ = "4.4.7.a1"
__version__ = "4.4.7.a2"
__codename__ = "Yeast Starter"

5 changes: 4 additions & 1 deletion cbpi/api/dataclasses.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@ class Actor:
def __str__(self):
return "name={} props={}, state={}, type={}, power={}, timer={}".format(self.name, self.props, self.state, self.type, self.power, self.timer)
def to_dict(self):
return dict(id=self.id, name=self.name, type=self.type, props=self.props.to_dict(), state=self.instance.get_state(), power=self.power, timer=self.timer)
if self.instance:
return dict(id=self.id, name=self.name, type=self.type, props=self.props.to_dict(), state=self.instance.get_state(), power=self.power, timer=self.timer)
else:
return dict(id=self.id, name=self.name, type="Not Available", props=self.props.to_dict(), state=False, power=0, timer=0)

class DataType(Enum):
VALUE="value"
Expand Down
1 change: 1 addition & 0 deletions cbpi/controller/basic_controller2.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ async def load(self):
await self.start(item.id)
await self.push_udpate()
except Exception as e:
#logging.error(e)
logging.warning("Invalid {} file - Creating empty file".format(self.path))
os.remove(self.path)
with open(self.path, "w") as file:
Expand Down

0 comments on commit aa55033

Please sign in to comment.