ihrapsa / KlipperWrt

A guide to install Klipper with fluidd, Mainsail or Duet-Web-Control and webcam stream in OpenWrt. Mainly created around the Creality Wi-Fi box but any OpenWrt running device with similar specs will work just fine.
180 stars 39 forks source link

[dev] moonraker machine.py adaptation #10

Open ihrapsa opened 3 years ago

ihrapsa commented 3 years ago

ln -s /etc/init.d/mjpg-streamer /etc/init.d/webcamd

async def shutdown_machine(self) -> None: await self._execute_cmd("poweroff")

    async def reboot_machine(self) -> None:
        await self._execute_cmd("reboot")

    async def do_service_action(self,
                                action: str,
                                service_name: str
                                ) -> None:
        await self._execute_cmd(
            f'/etc/init.d/{service_name} {action}')

async def _find_active_services(self): services = os.listdir("/etc/init.d/") for svc in services: for allowed in ALLOWED_SERVICES: if svc.startswith(allowed): self.available_services.append(svc) self.system_info['available_services'] = self.available_services