diff --git a/cbpi/__init__.py b/cbpi/__init__.py index 2a547cd..a48bba4 100644 --- a/cbpi/__init__.py +++ b/cbpi/__init__.py @@ -1 +1 @@ -__version__ = "4.0.2.0.a18" +__version__ = "4.0.2.0.a19" diff --git a/cbpi/controller/system_controller.py b/cbpi/controller/system_controller.py index af3c8a0..59a6eae 100644 --- a/cbpi/controller/system_controller.py +++ b/cbpi/controller/system_controller.py @@ -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: diff --git a/cbpi/extension/mqtt_actor/mqtt_actor.py b/cbpi/extension/mqtt_actor/mqtt_actor.py index 5788c12..28dd198 100644 --- a/cbpi/extension/mqtt_actor/mqtt_actor.py +++ b/cbpi/extension/mqtt_actor/mqtt_actor.py @@ -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: