mirror of
https://github.com/PiBrewing/craftbeerpi4.git
synced 2024-11-09 17:07:43 +01:00
Remove kettle and fermenter target temp logs and actor logs
This commit is contained in:
parent
f8024f3b49
commit
ab60c5c0fc
7 changed files with 2 additions and 38 deletions
|
@ -240,7 +240,6 @@ class FermentationController:
|
|||
if item:
|
||||
item.target_temp = target_temp
|
||||
self.save()
|
||||
self.cbpi.log.log_data(item.id, target_temp)
|
||||
self.push_update()
|
||||
except Exception as e:
|
||||
logging.error("Failed to set Target Temp {} {}".format(id, e))
|
||||
|
|
|
@ -30,7 +30,6 @@ class KettleController(BasicController):
|
|||
item = self.find_by_id(id)
|
||||
item.target_temp = target_temp
|
||||
await self.save()
|
||||
self.cbpi.log.log_data(item.id, target_temp)
|
||||
except Exception as e:
|
||||
logging.error("Failed to set Target Temp {} {}".format(id, e))
|
||||
|
||||
|
|
|
@ -69,28 +69,7 @@ class LogController:
|
|||
itemname=sensor.name.replace(" ", "_")
|
||||
for char in chars:
|
||||
itemname = itemname.replace(char,chars[char])
|
||||
out="sensor,source=" + itemname + ",itemID=" + str(id) + " value="+str(value)
|
||||
else:
|
||||
actor=self.cbpi.actor.find_by_id(name)
|
||||
if actor is not None:
|
||||
itemname=actor.name.replace(" ", "_")
|
||||
for char in chars:
|
||||
itemname = itemname.replace(char,chars[char])
|
||||
out="actor,source=" + itemname + ",itemID=" + str(id) + " value="+str(value)
|
||||
else:
|
||||
kettle=self.cbpi.kettle.find_by_id(name)
|
||||
if kettle is not None:
|
||||
itemname=kettle.name.replace(" ", "_")
|
||||
for char in chars:
|
||||
itemname = itemname.replace(char,chars[char])
|
||||
out="kettle,source=" + itemname + ",itemID=" + str(id) + " value="+str(value)
|
||||
else:
|
||||
fermenter=self.cbpi.fermenter._find_by_id(name)
|
||||
if fermenter is not None:
|
||||
itemname=fermenter.name.replace(" ", "_")
|
||||
for char in chars:
|
||||
itemname = itemname.replace(char,chars[char])
|
||||
out="fermenter,source=" + itemname + ",itemID=" + str(id) + " value="+str(value)
|
||||
out="measurement,source=" + itemname + ",itemID=" + str(id) + " value="+str(value)
|
||||
except Exception as e:
|
||||
logging.error("InfluxDB ID Error: {}".format(e))
|
||||
|
||||
|
@ -101,7 +80,7 @@ class LogController:
|
|||
http = urllib3.PoolManager()
|
||||
req = http.request('POST',self.influxdburl, body=out, headers = header)
|
||||
except Exception as e:
|
||||
logging.error("InfluxDB write Error: {}".format(e))
|
||||
logging.error("InfluxDB cloud write Error: {}".format(e))
|
||||
|
||||
else:
|
||||
self.influxdb = self.cbpi.config.get("INFLUXDB", "No")
|
||||
|
|
|
@ -25,12 +25,10 @@ class DummyActor(CBPiActor):
|
|||
await super().start()
|
||||
|
||||
async def on(self, power=0):
|
||||
self.log_data(100)
|
||||
logger.info("ACTOR %s ON " % self.id)
|
||||
self.state = True
|
||||
|
||||
async def off(self):
|
||||
self.log_data(0)
|
||||
logger.info("ACTOR %s OFF " % self.id)
|
||||
|
||||
self.state = False
|
||||
|
|
|
@ -63,13 +63,11 @@ class GPIOActor(CBPiActor):
|
|||
self.power = 100
|
||||
await self.set_power(self.power)
|
||||
|
||||
self.log_data(self.power)
|
||||
logger.info("ACTOR %s ON - GPIO %s " % (self.id, self.gpio))
|
||||
GPIO.output(self.gpio, self.get_GPIO_state(1))
|
||||
self.state = True
|
||||
|
||||
async def off(self):
|
||||
self.log_data(0)
|
||||
logger.info("ACTOR %s OFF - GPIO %s " % (self.id, self.gpio))
|
||||
GPIO.output(self.gpio, self.get_GPIO_state(0))
|
||||
self.state = False
|
||||
|
@ -95,8 +93,6 @@ class GPIOActor(CBPiActor):
|
|||
|
||||
async def set_power(self, power):
|
||||
self.power = power
|
||||
if self.state == True:
|
||||
self.log_data(self.power)
|
||||
await self.cbpi.actor.actor_update(self.id,power)
|
||||
pass
|
||||
|
||||
|
@ -135,7 +131,6 @@ class GPIOPWMActor(CBPiActor):
|
|||
|
||||
logging.info("PWM Final Power: {}".format(self.power))
|
||||
|
||||
self.log_data(self.power)
|
||||
logger.info("PWM ACTOR %s ON - GPIO %s - Frequency %s - Power %s" % (self.id, self.gpio,self.frequency,self.power))
|
||||
try:
|
||||
if self.p is None:
|
||||
|
@ -147,14 +142,12 @@ class GPIOPWMActor(CBPiActor):
|
|||
pass
|
||||
|
||||
async def off(self):
|
||||
self.log_data(0)
|
||||
logger.info("PWM ACTOR %s OFF - GPIO %s " % (self.id, self.gpio))
|
||||
self.p.ChangeDutyCycle(0)
|
||||
self.state = False
|
||||
|
||||
async def set_power(self, power):
|
||||
if self.p and self.state == True:
|
||||
self.log_data(self.power)
|
||||
self.p.ChangeDutyCycle(power)
|
||||
await self.cbpi.actor.actor_update(self.id,power)
|
||||
pass
|
||||
|
|
|
@ -27,13 +27,11 @@ class GenericMqttActor(MQTTActor):
|
|||
|
||||
async def on(self, power=None):
|
||||
self.normalize_power_value(power)
|
||||
self.log_data(self.power)
|
||||
formatted_payload = self.payload.format(switch_onoff = "on", switch_10 = 1, power = self.power)
|
||||
await self.publish_mqtt_message(self.topic, formatted_payload)
|
||||
self.state = True
|
||||
|
||||
async def off(self):
|
||||
self.log_data(0)
|
||||
formatted_payload = self.payload.format(switch_onoff = "off", switch_10 = 0, power = self.power)
|
||||
await self.publish_mqtt_message(self.topic, formatted_payload)
|
||||
self.state = False
|
|
@ -29,7 +29,6 @@ class MQTTActor(CBPiActor):
|
|||
power = min(100, power)
|
||||
power = max(0, power)
|
||||
self.power = round(power)
|
||||
self.log_data(self.power)
|
||||
await self.cbpi.satellite.publish(self.topic, json.dumps(
|
||||
{"state": "on", "power": self.power}), True)
|
||||
self.state = True
|
||||
|
@ -37,7 +36,6 @@ class MQTTActor(CBPiActor):
|
|||
|
||||
async def off(self):
|
||||
self.state = False
|
||||
self.log_data(0)
|
||||
await self.cbpi.satellite.publish(self.topic, json.dumps(
|
||||
{"state": "off", "power": self.power}), True)
|
||||
pass
|
||||
|
|
Loading…
Reference in a new issue