Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[dev] moonraker machine.py adaptation #10

Open
ihrapsa opened this issue Jun 19, 2021 · 0 comments
Open

[dev] moonraker machine.py adaptation #10

ihrapsa opened this issue Jun 19, 2021 · 0 comments
Assignees
Labels
documentation Improvements or additions to documentation enhancement New feature or request

Comments

@ihrapsa
Copy link
Owner

ihrapsa commented Jun 19, 2021

  • Make a symlink from webcamd -> mjpg-streamer

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

  • Change to the following to make the cllient buttons work:
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}')
  • Change to the following to check allowed services:
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
@ihrapsa ihrapsa self-assigned this Jun 19, 2021
@ihrapsa ihrapsa added documentation Improvements or additions to documentation enhancement New feature or request labels Jun 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant