Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
flockwave-server / server / ext / lps / examples.py
Size: Mime:
from trio import sleep
from typing import Any

from .model import LocalPositioningSystem, LocalPositioningSystemType

__all__ = ("DummyLocalPositioningSystem",)


class DummyLocalPositioningSystem(LocalPositioningSystem):
    """Dummy local positioning system (LPS) that does nothing.

    This LPS instance is mostly for illustrative and testing purposes.
    """

    async def calibrate(self) -> None:
        await sleep(3)

    def _configure_inner(self, cfg: dict[str, Any]) -> None:
        pass


class DummyLocalPositioningSystemType(
    LocalPositioningSystemType[DummyLocalPositioningSystem]
):
    """Example local positioning system (LPS) type that does nothing.

    This LPS type is mostly for illustrative and testing purposes.
    """

    @property
    def description(self) -> str:
        return "Local positioning system example that does nothing."

    @property
    def name(self) -> str:
        return "Dummy LPS"

    def create(self) -> DummyLocalPositioningSystem:
        return DummyLocalPositioningSystem()

    def get_configuration_schema(self) -> dict[str, Any]:
        return {}