{"id":27288,"library":"pymammotion","title":"PyMammotion","description":"A Python library for controlling Mammotion robotic lawn mowers (Luba, Yuka) over local network. Version 0.7.87 requires Python >=3.14. Provides async device discovery, message parsing, and command sending. Development is active, but the API is still evolving.","status":"active","version":"0.7.87","language":"python","source_language":"en","source_url":"https://github.com/mammotion-oss/pymammotion","tags":["mammotion","robotic-mower","luba","yuka","iot","async"],"install":[{"cmd":"pip install pymammotion","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Binary protocol parsing","package":"construct","optional":false},{"reason":"Async HTTP communication","package":"aiohttp","optional":false},{"reason":"Encryption/decryption of device commands","package":"cryptography","optional":false}],"imports":[{"note":"MammotionDiscovery is in the discovery submodule, not top-level.","wrong":"from pymammotion import MammotionDiscovery","symbol":"MammotionDiscovery","correct":"from pymammotion.discovery import MammotionDiscovery"},{"note":"Device class is in the device submodule.","wrong":"from pymammotion import MammotionDevice","symbol":"MammotionDevice","correct":"from pymammotion.device import MammotionDevice"},{"note":"Client class is in the client submodule.","wrong":"from pymammotion import MammotionClient","symbol":"MammotionClient","correct":"from pymammotion.client import MammotionClient"},{"note":"Cloud class is in the cloud submodule.","wrong":"from pymammotion import MammotionCloud","symbol":"MammotionCloud","correct":"from pymammotion.cloud import MammotionCloud"},{"note":"API class is in the api submodule.","wrong":"from pymammotion import MammotionApi","symbol":"MammotionApi","correct":"from pymammotion.api import MammotionApi"}],"quickstart":{"code":"import asyncio\nfrom pymammotion.discovery import MammotionDiscovery\n\nasync def main():\n    discovery = MammotionDiscovery()\n    devices = await discovery.discover()\n    for device in devices:\n        print(f\"Found: {device.name}\")\n\nasyncio.run(main())","lang":"python","description":"Discover Mammotion devices on the local network."},"warnings":[{"fix":"Update imports to use the new submodules: from pymammotion.discovery import MammotionDiscovery, etc.","message":"Before version 0.7.0, the main class was `Mammotion` directly from `pymammotion`. It has been replaced by separate `MammotionDiscovery`, `MammotionDevice`, etc. Old code importing `from pymammotion import Mammotion` will break.","severity":"breaking","affected_versions":"<0.7.0"},{"fix":"Replace `from pymammotion.mower import ...` with `from pymammotion.device import ...`.","message":"The `mower` module is deprecated in favor of `device`. Using `from pymammotion.mower import ...` will still work but prints a deprecation warning.","severity":"deprecated","affected_versions":">=0.6.0 <0.8.0"},{"fix":"Run discovery on the same LAN. Use static IP configuration if cross-subnet is needed.","message":"Discovery uses UDP broadcast and may not work across subnets or VPNs. Ensure your device is on the same network segment.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use: from pymammotion.discovery import MammotionDiscovery","cause":"Importing from the wrong location; MammotionDiscovery is in the discovery submodule.","error":"AttributeError: module 'pymammotion' has no attribute 'MammotionDiscovery'"},{"fix":"Use: await discovery.discover()","cause":"Discovery method not awaited; it is a coroutine.","error":"TypeError: object NoneType can't be used in 'await' expression"},{"fix":"Check device capabilities using device.supported_commands or refer to the docs for your device.","cause":"Some commands are not supported on all device models (e.g., Luba vs Yuka).","error":"NotImplementedError: Command not implemented for this device model"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}