- refactored hendi_ctrl

- fixed hend_heater
- added workaround for typedDict and Python < v3.8
This commit is contained in:
jens
2021-10-19 06:32:45 +01:00
parent 7c6004807d
commit bd63f2648c
4 changed files with 67 additions and 5 deletions
Regular → Executable
+1 -1
View File
@@ -18,7 +18,7 @@ class HeaterHendi(AHeater):
def get_powers(self):
caps = self.hendi.getCapabilties()
return [0].extend(caps['pwr_list'])
return [0] + caps['pwr_list']
def activate(self, enable):
if enable:
Regular → Executable
+6 -3
View File
@@ -22,8 +22,6 @@ class HendiCtrl:
powers = [500, 600, 700, 800, 900, 1000, 1100, 1200, 1300, 1400, 1500, 1600, 1700, 1800, 1900, 2000, 2100, 2200, 2300, 2400, 2500, 2600, 2700, 2800, 2900, 3000, 3100, 3200, 3300,3400, 3500]
digits = [4092, 3840, 3700, 3440, 3300, 3060, 3000, 2930, 2860, 2780, 2640, 2510, 2430, 2360, 2190, 2130, 2030, 1980, 1880, 1730, 1630, 1560, 1480, 1400, 1240, 1150, 1150, 1080, 920, 740, 670]
self.caps = {
"sw_id" : self.getSoftwareIdentifier(),
"sw_ver" : self.getSoftwareVersion(),
"pwr_watts_min" : powers[0],
"pwr_watts_max" : powers[-1],
"pwr_list" : powers,
@@ -124,7 +122,8 @@ class HendiCtrl:
def getInfo(self):
result = {
'caps' : self.caps,
"sw_id" : self.getSoftwareIdentifier(),
"sw_ver" : self.getSoftwareVersion(),
'state' : self.getState(),
'pwr_digits' : self.getPowerDigits(),
'Switch_state' : self.getSwitch()
@@ -188,6 +187,10 @@ if __name__ == '__main__':
hendi.getState()
hendi.getSoftwareIdentifier()
hendi.getSoftwareVersion()
caps = hendi.getCapabilties()
print("Caps: ", caps)
info = hendi.getInfo()
print("Info: ", info)
print("Test converters")
for pwr in range(500, 3600, 100):