mirror of
https://github.com/PiBrewing/craftbeerpi4.git
synced 2024-11-28 09:44:20 +01:00
wlan0 speed fix for linux / defalt mqtt actor off on startup
This commit is contained in:
parent
12803b62c4
commit
aa76c908ef
3 changed files with 8 additions and 4 deletions
|
@ -1 +1 @@
|
|||
__version__ = "4.0.2.0.a18"
|
||||
__version__ = "4.0.2.0.a19"
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue