758 try: |
758 try: |
759 error = self.__statusTranslations[result["status"]] |
759 error = self.__statusTranslations[result["status"]] |
760 except KeyError: |
760 except KeyError: |
761 error = str(result["status"]) |
761 error = str(result["status"]) |
762 |
762 |
|
763 self._networkConnected = result["connected"] |
|
764 |
763 return result["connected"], error |
765 return result["connected"], error |
764 |
766 |
765 def disconnectWifi(self): |
767 def disconnectWifi(self): |
766 """ |
768 """ |
767 Public method to disconnect a device from the WiFi network. |
769 Public method to disconnect a device from the WiFi network. |
788 """ |
790 """ |
789 |
791 |
790 out, err = self.executeCommands(command, mode=self._submitMode) |
792 out, err = self.executeCommands(command, mode=self._submitMode) |
791 if err: |
793 if err: |
792 return False, err |
794 return False, err |
|
795 |
|
796 self._networkConnected = False |
793 |
797 |
794 return out.decode("utf-8").strip() == "True", "" |
798 return out.decode("utf-8").strip() == "True", "" |
795 |
799 |
796 def writeCredentials(self, ssid, password): |
800 def writeCredentials(self, ssid, password): |
797 """ |
801 """ |