diff --git a/cbpi/__init__.py b/cbpi/__init__.py index 27f3b78..6cf8058 100644 --- a/cbpi/__init__.py +++ b/cbpi/__init__.py @@ -1 +1 @@ -__version__ = "4.0.0.38" +__version__ = "4.0.0.39" diff --git a/cbpi/extension/mashstep/__init__.py b/cbpi/extension/mashstep/__init__.py index 3a2f086..4c07bff 100644 --- a/cbpi/extension/mashstep/__init__.py +++ b/cbpi/extension/mashstep/__init__.py @@ -73,6 +73,7 @@ class MashInStep(CBPiStep): async def on_timer_done(self,timer): self.summary = "" + self.kettle.target_temp = 0 await self.push_update() if self.AutoMode == True: await self.setAutoMode(False) @@ -152,6 +153,7 @@ class MashStep(CBPiStep): async def on_timer_done(self,timer): self.summary = "" + self.kettle.target_temp = 0 if self.AutoMode == True: await self.setAutoMode(False) self.cbpi.notify(self.name, 'Step finished', NotificationType.SUCCESS) @@ -173,6 +175,10 @@ class MashStep(CBPiStep): if self.cbpi.kettle is not None and self.timer is None: self.timer = Timer(int(self.props.get("Timer",0)) *60 ,on_update=self.on_timer_update, on_done=self.on_timer_done) + elif self.cbpi.kettle is not None and self.timer: + self.timer.start() + self.timer.is_running = True + self.summary = "Waiting for Target Temp" await self.push_update() @@ -368,6 +374,9 @@ class BoilStep(CBPiStep): if self.cbpi.kettle is not None and self.timer is None: self.timer = Timer(int(self.props.get("Timer", 0)) *60 ,on_update=self.on_timer_update, on_done=self.on_timer_done) + elif self.cbpi.kettle is not None and self.timer: + self.timer.start() + self.timer.is_running = True self.summary = "Waiting for Target Temp" if self.AutoMode == True: diff --git a/cbpi/http_endpoints/http_sensor.py b/cbpi/http_endpoints/http_sensor.py index 240deb8..3b0af16 100644 --- a/cbpi/http_endpoints/http_sensor.py +++ b/cbpi/http_endpoints/http_sensor.py @@ -229,3 +229,39 @@ class SensorHttpEndpoints(): logging.info(sensor_value) return web.json_response(data=sensor_value) + @request_mapping(path="/{id}/action", method="POST", auth_required=auth) + async def http_action(self, request) -> web.Response: + """ + + --- + description: Call Action for Sensor + tags: + - Sensor + parameters: + - name: "id" + in: "path" + description: "Actor ID" + required: true + type: "integer" + format: "int64" + - in: body + name: body + description: Update an actor + required: false + schema: + type: object + properties: + name: + type: string + parameter: + type: object + responses: + "204": + description: successful operation + """ + sensor_id = request.match_info['id'] + data = await request.json() + print(data) + await self.controller.call_action(sensor_id, data.get("action"), data.get("parameter")) + + return web.Response(status=204)