wlan0 speed fix for linux / defalt mqtt actor off on startup

This commit is contained in:
avollkopf 2022-03-09 08:25:17 +01:00
parent 12803b62c4
commit aa76c908ef
3 changed files with 8 additions and 4 deletions

View file

@ -1 +1 @@
__version__ = "4.0.2.0.a18" __version__ = "4.0.2.0.a19"

View file

@ -238,8 +238,10 @@ class SystemController:
eth0speed = "down" eth0speed = "down"
if nic == 'wlan0': if nic == 'wlan0':
if info[nic].isup == True: if info[nic].isup == True:
if info[nic].speed: ratestring = os.popen('iwlist wlan0 rate | grep Rate').read()
wlan0speed = info[nic].speed start = ratestring.find("=") + 1
end = ratestring.find(" Mb/s")
wlan0speed = ratestring[start:end]
else: else:
wlan0speed = "down" wlan0speed = "down"
except Exception as e: except Exception as e:

View file

@ -22,6 +22,8 @@ class MQTTActor(CBPiActor):
async def on_start(self): async def on_start(self):
self.topic = self.props.get("Topic", None) self.topic = self.props.get("Topic", None)
self.power = 100 self.power = 100
await self.off()
self.state = False
async def on(self, power=None): async def on(self, power=None):
if power is not None: if power is not None: