initial import
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
from components.atemperatureSensor import ATemperatureSensor
|
||||
import math
|
||||
|
||||
|
||||
class TempSensorSim(ATemperatureSensor):
|
||||
def name(self):
|
||||
return "FakeTemp"
|
||||
|
||||
def __init__(self):
|
||||
self.count = 0
|
||||
self.freq = 0.2
|
||||
self.log("Created")
|
||||
self.temp = 22.37
|
||||
|
||||
def set_fake_temp(self, temp):
|
||||
self.temp = temp
|
||||
|
||||
def temperature(self):
|
||||
self.count += 1
|
||||
return self.temp + 0.0*math.sin(2*math.pi*self.count*self.freq)
|
||||
|
||||
Reference in New Issue
Block a user