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

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

View file

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