def main(self): App.main(self) if(os.path.exists("settings.json")): settings.S_DATA = settings.Skylight_Settings.from_json("settings.json") else: # create default settings settings.S_DATA = settings.Skylight_Settings() self.color = Color_raw(0,0,0,0) # Run GUI self.gui_main() settings.S_DATA.save_json("settings.json")
def main(self): App.main(self) # Autodiscover device if necessary if self.options.addr == None: self.log.info("Bluetooth address not specified. Searching for matching device...") devs = btLink.discover() if len(devs) == 0: self.log.error("No devices found") sys.exit(1) else: self.log.info("Using device: %s - %s" % (devs[0][0], devs[0][1])) self.options.addr = devs[0][0] with btLink.btLink(self.options.addr) as S: S.enter_bootloader() S.send_ihex(self.options.filename) S.exit_bootloader() S.set_time()