[
  {
    "path": ".devcontainer.json",
    "content": "{\n  \"customizations\": {\n    \"vscode\": {\n      \"extensions\": [\n        \"esbenp.prettier-vscode\",\n        \"github.vscode-pull-request-github\",\n        \"ms-python.python\",\n        \"ms-python.vscode-pylance\",\n        \"ms-vscode.makefile-tools\",\n        \"ryanluker.vscode-coverage-gutters\",\n        \"visualstudioexptteam.vscodeintellicode\"\n      ],\n      \"settings\": {\n        \"editor.formatOnPaste\": false,\n        \"editor.formatOnSave\": true,\n        \"editor.formatOnType\": true,\n        \"editor.tabSize\": 4,\n        \"files.eol\": \"\\n\",\n        \"files.trimTrailingWhitespace\": true,\n        \"python.analysis.autoImportCompletions\": true,\n        \"python.analysis.autoSearchPaths\": false,\n        \"python.analysis.extraPaths\": [\"/home/vscode/.local/lib/python*/\"],\n        \"python.analysis.typeCheckingMode\": \"basic\",\n        \"python.defaultInterpreterPath\": \"/usr/local/bin/python\",\n        \"python.formatting.autopep8Path\": \"/usr/local/py-utils/bin/autopep8\",\n        \"python.formatting.blackPath\": \"/usr/local/py-utils/bin/black\",\n        \"python.formatting.provider\": \"black\",\n        \"python.formatting.yapfPath\": \"/usr/local/py-utils/bin/yapf\",\n        \"python.languageServer\": \"Pylance\",\n        \"python.linting.banditPath\": \"/usr/local/py-utils/bin/bandit\",\n        \"python.linting.enabled\": true,\n        \"python.linting.flake8Path\": \"/usr/local/py-utils/bin/flake8\",\n        \"python.linting.mypyEnabled\": true,\n        \"python.linting.mypyPath\": \"/usr/local/py-utils/bin/mypy\",\n        \"python.linting.pycodestylePath\": \"/usr/local/py-utils/bin/pycodestyle\",\n        \"python.linting.pydocstylePath\": \"/usr/local/py-utils/bin/pydocstyle\",\n        \"python.linting.pylintArgs\": [\"--disable\", \"import-error\"],\n        \"python.linting.pylintEnabled\": true,\n        \"python.linting.pylintPath\": \"/usr/local/py-utils/bin/pylint\",\n        \"python.pythonPath\": \"/usr/local/python/bin/python\",\n        \"python.testing.pytestEnabled\": true,\n        \"python.testing.unittestEnabled\": false,\n        \"terminal.integrated.defaultProfile.linux\": \"zsh\",\n        \"terminal.integrated.profiles.linux\": {\n          \"zsh\": {\n            \"path\": \"/usr/bin/zsh\"\n          }\n        }\n      }\n    }\n  },\n  \"features\": {\n    \"rust\": \"latest\"\n  },\n  \"forwardPorts\": [8123],\n  \"image\": \"mcr.microsoft.com/devcontainers/python:3\",\n  \"name\": \"Deebot 4 HA\",\n  \"portsAttributes\": {\n    \"0-8122\": {\n      \"label\": \"Auto-Forwarded - Other\",\n      \"onAutoForward\": \"ignore\"\n    },\n    \"8123\": {\n      \"label\": \"Home Assistant\"\n    },\n    \"8124-999999\": {\n      \"label\": \"Auto-Forwarded - Other\",\n      \"onAutoForward\": \"ignore\"\n    }\n  },\n  \"postCreateCommand\": \"scripts/setup\",\n  \"remoteUser\": \"vscode\",\n  \"runArgs\": [\"-e\", \"GIT_EDITOR=code --wait\"]\n}\n"
  },
  {
    "path": ".gitattributes",
    "content": "text=auto eol=lf\n"
  },
  {
    "path": ".github/FUNDING.yml",
    "content": "custom: [\"https://www.buymeacoffee.com/edenhaus\"]\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/bug.yml",
    "content": "name: Report an issue/bug\ndescription: Report a issue/bug\nlabels: [bug]\nbody:\n  - type: markdown\n    attributes:\n      value: |\n        This issue form is for reporting bugs only!\n\n        If you have a feature request or a question, please use discussions.\n  - type: checkboxes\n    attributes:\n      label: Checks\n      options:\n        - label: I have searched the existing issues and no issue is describing my issue\n          required: true\n        - label: I have checked the [FAQ](https://deebot.readthedocs.io/home/faq/)\n          required: true\n        - label: I have checked the [documentation](https://deebot.readthedocs.io/integrations/home-assistant)\n          required: true\n        - label: I have installed the latest version\n          required: true\n\n  - type: textarea\n    validations:\n      required: true\n    attributes:\n      label: The problem\n      description: >-\n        Describe the issue you are experiencing here to communicate to the\n        maintainers. Tell us what you were trying to do and what happened.\n\n        Provide a clear and concise description of what the problem is.\n\n  - type: markdown\n    attributes:\n      value: |\n        ## Environment\n  - type: textarea\n    validations:\n      required: true\n    attributes:\n      label: Diagnostics information\n      description: >-\n        Download the diagnostic data for the device you are having issues with (found on the device page),\n        and drag-and-drop that file into the textbox below.\n\n  - type: markdown\n    attributes:\n      value: |\n        # Details\n  - type: textarea\n    attributes:\n      label: Anything in the logs that might be useful for us?\n      description: >\n        For example, error message, or stack traces.\n\n        Please refer to the [documentation](https://deebot.readthedocs.io/integrations/home-assistant/issues/).\n      render: txt\n  - type: textarea\n    attributes:\n      label: Additional information\n      description: >\n        If you have any additional information for us, use the field below.\n        Please note, you can attach screenshots or screen recordings here, by\n        dragging and dropping files in the field below.\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/bug_setup.yml",
    "content": "name: Report an issue/bug during during installation or configuration\ndescription: Report a issue/bug during installation or configuration\nlabels: [bug]\nbody:\n  - type: markdown\n    attributes:\n      value: |\n        This issue form is for reporting setup/install bugs only!\n\n        If you have successfully configured your robot, please use the other issue form.\n        If you have a feature request or a question, please use discussions.\n  - type: checkboxes\n    attributes:\n      label: Checks\n      options:\n        - label: I have searched the existing issues and no issue is describing my issue\n          required: true\n        - label: I have checked the [FAQ](https://deebot.readthedocs.io/home/faq/)\n          required: true\n        - label: I have checked the [documentation](https://deebot.readthedocs.io/integrations/home-assistant)\n          required: true\n        - label: I have installed/try to install the latest version\n          required: true\n\n  - type: textarea\n    validations:\n      required: true\n    attributes:\n      label: The problem\n      description: >-\n        Describe the issue you are experiencing here to communicate to the\n        maintainers. Tell us what you were trying to do and what happened.\n\n        Provide a clear and concise description of what the problem is.\n\n  - type: markdown\n    attributes:\n      value: |\n        ## Environment\n  - type: input\n    id: device\n    validations:\n      required: true\n    attributes:\n      label: On which deebot vacuum you have the issue?\n      placeholder: Deebot Ozmo 950\n  - type: input\n    id: version\n    validations:\n      required: true\n    attributes:\n      label: Which version of the Deebot component are you using?\n      placeholder: X.X.X\n      description: >\n        Will be logged during starting on Level Info. Can be found in the log file.\n        Latest is not a valid version!\n  - type: input\n    id: ha_version\n    validations:\n      required: true\n    attributes:\n      label: Which version of Home Assistant are you using?\n      placeholder: 202X.X.X\n      description: >\n        Can be found in the Configuration panel -> Info.\n  - type: dropdown\n    validations:\n      required: true\n    attributes:\n      label: What type of installation are you running?\n      description: >\n        If you don't know, you can find it in: Configuration panel -> Info.\n      options:\n        - Home Assistant OS\n        - Home Assistant Container\n        - Home Assistant Supervised\n        - Home Assistant Core\n\n  - type: markdown\n    attributes:\n      value: |\n        # Configuration\n  - type: input\n    id: country\n    attributes:\n      label: Country\n      placeholder: it\n      description: >\n        Which country did you input during the setup of the integration?\n  - type: input\n    id: continent\n    attributes:\n      label: Continent\n      placeholder: eu\n      description: >\n        Which continent did you input during the setup of the integration?\n  - type: dropdown\n    attributes:\n      label: Instance type\n      description: >\n        If you don't know, please select \"Cloud\". If you have running a bumper instance and you are using it,\n        then and ONLY then select \"Bumper\"\n      options:\n        - Cloud\n        - Bumper\n\n  - type: markdown\n    attributes:\n      value: |\n        # Details\n  - type: textarea\n    attributes:\n      label: Anything in the logs that might be useful for us?\n      description: >\n        For example, error message, or stack traces.\n\n        Please refer to the [documentation](https://deebot.readthedocs.io/integrations/home-assistant/issues/).\n      render: txt\n  - type: textarea\n    attributes:\n      label: Additional information\n      description: >\n        If you have any additional information for us, use the field below.\n        Please note, you can attach screenshots or screen recordings here, by\n        dragging and dropping files in the field below.\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/config.yml",
    "content": "blank_issues_enabled: false\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/feature_request.yml",
    "content": "name: \"💡 Suggest an feature/idea\"\ndescription: \"💡 Suggest an feature/idea\"\nlabels: [enhancement]\nbody:\n  - type: markdown\n    attributes:\n      value: |\n        This issue form is for reporting features or ideas only!\n\n        If you have a bug/issue or a question, please use the other templates.\n  - type: checkboxes\n    attributes:\n      label: Is there an existing issue for this?\n      description: Please search to see if an issue already exists for your feature request or idea\n      options:\n        - label: I have searched the existing issues and no issue is describing my feature request or idea\n          required: true\n\n  - type: textarea\n    attributes:\n      label: Is your feature request related to a problem?\n      description: >\n        A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]\n\n  - type: textarea\n    validations:\n      required: true\n    attributes:\n      label: Suggested solution\n      description: >\n        A clear and concise description of what you want to happen.\n\n  - type: textarea\n    attributes:\n      label: Api example request\n      description: >\n        If for your feature a sample requests exist, please paste it here.\n        This speed things up, specially for new commands\n      render: txt\n\n  - type: textarea\n    attributes:\n      label: Alternatives you've considered\n      description: >\n        A clear and concise description of any alternative solutions or features you've considered.\n\n  - type: textarea\n    attributes:\n      label: Additional information\n      description: >\n        If you have any additional information for us, use the field below.\n        Please note, you can attach screenshots or screen recordings here, by\n        dragging and dropping files in the field below.\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/question.yml",
    "content": "name: \"❓ Ask a Question\"\ndescription: \"❓ Ask a Question\"\nlabels: [question]\nbody:\n  - type: markdown\n    attributes:\n      value: |\n        This issue form is for questions!\n\n        If you have a bug/issue or a feature request, please use the other templates.\n\n  - type: textarea\n    attributes:\n      label: Question\n      description: >\n        A clear and concise description\n\n  - type: textarea\n    attributes:\n      label: Additional information\n      description: >\n        If you have any additional information for us, use the field below.\n        Please note, you can attach screenshots or screen recordings here, by\n        dragging and dropping files in the field below.\n"
  },
  {
    "path": ".github/dependabot.yml",
    "content": "version: 2\nupdates:\n  # Maintain dependencies for GitHub Actions\n  - package-ecosystem: \"github-actions\"\n    directory: \"/\"\n    labels:\n      - \"pr: dependency-update\"\n    schedule:\n      interval: \"daily\"\n\n  # Maintain dependencies for pip\n  - package-ecosystem: \"pip\"\n    directory: \"/\"\n    labels:\n      - \"pr: dependency-update\"\n    schedule:\n      interval: \"daily\"\n"
  },
  {
    "path": ".github/release-drafter.yml",
    "content": "name-template: \"$RESOLVED_VERSION\"\ntag-template: \"$RESOLVED_VERSION\"\nchange-template: \"- #$NUMBER $TITLE @$AUTHOR\"\nsort-direction: ascending\nfilter-by-commitish: true\ncategories:\n  - title: \":boom: Breaking changes\"\n    label: \"pr: Breaking Change\"\n\n  - title: \":sparkles: New features\"\n    label: \"pr: new-feature\"\n\n  - title: \":zap: Enhancements\"\n    label: \"pr: enhancement\"\n\n  - title: \":recycle: Refactor\"\n    label: \"pr: refactor\"\n\n  - title: \":bug: Bug Fixes\"\n    label: \"pr: bugfix\"\n\n  - title: \":arrow_up: Dependency Updates\"\n    labels:\n      - \"pr: dependency-update\"\n      - \"dependencies\"\n\ninclude-labels:\n  - \"pr: Breaking Change\"\n  - \"pr: enhancement\"\n  - \"pr: dependency-update\"\n  - \"pr: new-feature\"\n  - \"pr: bugfix\"\n  - \"pr: refactor\"\n\nversion-resolver:\n  major:\n    labels:\n      - \"pr: Breaking Change\"\n  minor:\n    labels:\n      - \"pr: enhancement\"\n      - \"pr: dependency-update\"\n      - \"pr: new-feature\"\n  patch:\n    labels:\n      - \"pr: bugfix\"\n  default: patch\n\ntemplate: |\n  [![Downloads for this release](https://img.shields.io/github/downloads/DeebotUniverse/Deebot-4-Home-Assistant/$RESOLVED_VERSION/total.svg)](https://github.com/DeebotUniverse/Deebot-4-Home-Assistant/releases/$RESOLVED_VERSION)\n  $CHANGES\n\n  **Like my work and want to support me?**\n  <a href=\"https://www.buymeacoffee.com/edenhaus\" target=\"_blank\"><img src=\"https://cdn.buymeacoffee.com/buttons/default-black.png\" width=\"150px\" height=\"35px\" alt=\"Buy Me A Coffee\" style=\"height: 35px !important;width: 150px !important;\" ></a>\n"
  },
  {
    "path": ".github/workflows/ci.yml",
    "content": "# This workflow will install Python dependencies, run tests and lint with a single version of Python\n# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions\n\nname: CI\n\non:\n  push:\n    branches:\n      - dev\n  pull_request: ~\n\nenv:\n  DEFAULT_PYTHON: \"3.11\"\n\njobs:\n  validate-hacs:\n    runs-on: \"ubuntu-latest\"\n    name: Validate with HACS\n    steps:\n      - uses: \"actions/checkout@v4\"\n\n      - name: HACS validation\n        uses: \"hacs/action@main\"\n        with:\n          category: \"integration\"\n\n  validate-hassfest:\n    runs-on: \"ubuntu-latest\"\n    name: Validate with Hassfest\n    steps:\n      - uses: \"actions/checkout@v4\"\n\n      - name: Hassfest validation\n        uses: \"home-assistant/actions/hassfest@master\"\n\n  code-quality:\n    runs-on: \"ubuntu-latest\"\n    name: Check code quality\n    steps:\n      - uses: \"actions/checkout@v4\"\n      - name: Set up Python ${{ env.DEFAULT_PYTHON }}\n        id: python\n        uses: actions/setup-python@v5\n        with:\n          python-version: ${{ env.DEFAULT_PYTHON }}\n          cache: \"pip\"\n      - name: Install dependencies\n        run: |\n          pip install -r requirements.txt\n      # Following steps cannot run by pre-commit.ci as repo = local\n      - name: Run mypy\n        run: mypy custom_components/\n      - name: Pylint review\n        run: pylint custom_components/\n\n  create_zip_file:\n    name: Create zip file for testing\n    permissions:\n      # Required to upload/save artifact, otherwise you'll get\n      # \"Error: Resource not accessible by integration\"\n      contents: write\n      # Required to post comment, otherwise you'll get\n      # \"Error: Resource not accessible by integration\"\n      pull-requests: write\n    needs:\n      - code-quality\n    runs-on: ubuntu-latest\n    if: github.event_name == 'pull_request'\n    steps:\n      - name: 📥 Checkout the repository\n        uses: actions/checkout@v4\n\n      - name: 📦 Create zip file for the integration\n        run: |\n          cd \"${{ github.workspace }}/custom_components/deebot\"\n          zip deebot.zip -r ./\n          mv deebot.zip \"${{ github.workspace }}/\"\n\n      - name: 📤 Create comment with the artifiactory\n        uses: gavv/pull-request-artifacts@v2\n        with:\n          # Commit hash that triggered PR\n          commit: ${{ github.event.pull_request.head.sha }}\n\n          # Token for current repo (used to post PR comment)\n          repo-token: ${{ secrets.GITHUB_TOKEN }}\n\n          artifacts-branch: artifacts\n          inter-link: false\n\n          comment-title: |\n            🤖 Pull request artifacts\n\n            For testing please download the zip file below and extract it in `[config folder]/custom_components/deebot`.\n\n          # Whitespace-separated list of files to upload\n          artifacts: |\n            deebot.zip\n"
  },
  {
    "path": ".github/workflows/codeql-analysis.yml",
    "content": "# For most projects, this workflow file will not need changing; you simply need\n# to commit it to your repository.\n#\n# You may wish to alter this file to override the set of languages analyzed,\n# or to provide custom queries or build logic.\n#\n# ******** NOTE ********\n# We have attempted to detect the languages in your repository. Please check\n# the `language` matrix defined below to confirm you have the correct set of\n# supported CodeQL languages.\n#\nname: \"CodeQL\"\n\non:\n  push:\n    branches:\n      - dev\n  pull_request:\n    # The branches below must be a subset of the branches above\n    branches:\n      - dev\n  schedule:\n    - cron: \"20 10 * * 0\"\n\njobs:\n  analyze:\n    name: Analyze\n    runs-on: ubuntu-latest\n    permissions:\n      actions: read\n      contents: read\n      security-events: write\n\n    strategy:\n      fail-fast: false\n      matrix:\n        language: [\"python\"]\n        # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]\n        # Learn more:\n        # https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed\n\n    steps:\n      - name: Checkout repository\n        uses: actions/checkout@v4\n\n      # Initializes the CodeQL tools for scanning.\n      - name: Initialize CodeQL\n        uses: github/codeql-action/init@v3\n        with:\n          languages: ${{ matrix.language }}\n          # If you wish to specify custom queries, you can do so here or in a config file.\n          # By default, queries listed here will override any specified in a config file.\n          # Prefix the list here with \"+\" to use these queries and those in the config file.\n          # queries: ./path/to/local/query, your-org/your-repo/queries@main\n\n      # Autobuild attempts to build any compiled languages  (C/C++, C#, or Java).\n      # If this step fails, then you should remove it and run the build manually (see below)\n      - name: Autobuild\n        uses: github/codeql-action/autobuild@v3\n\n      # ℹ️ Command-line programs to run using the OS shell.\n      # 📚 https://git.io/JvXDl\n\n      # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines\n      #    and modify them (or add more) to build your code if your project\n      #    uses a compiled language\n\n      # - run: |\n      #   make bootstrap\n      #   make release\n\n      - name: Perform CodeQL Analysis\n        uses: github/codeql-action/analyze@v3\n"
  },
  {
    "path": ".github/workflows/cron.yaml",
    "content": "name: Cron actions\n\non:\n  schedule:\n    - cron: \"0 0 * * *\"\n\njobs:\n  validate:\n    runs-on: \"ubuntu-latest\"\n    name: Validate\n    steps:\n      - uses: \"actions/checkout@v4\"\n\n      - name: HACS validation\n        uses: \"hacs/action@main\"\n        with:\n          category: \"integration\"\n\n      - name: Hassfest validation\n        uses: \"home-assistant/actions/hassfest@master\"\n"
  },
  {
    "path": ".github/workflows/release-drafter.yml",
    "content": "name: Release Drafter\n\non:\n  push:\n    branches:\n      - dev\n\njobs:\n  update_release_draft:\n    runs-on: ubuntu-latest\n    permissions:\n      contents: write\n    steps:\n      - uses: release-drafter/release-drafter@v5\n        env:\n          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n"
  },
  {
    "path": ".github/workflows/release.yml",
    "content": "# This GitHub action workflow is meant to be copyable to any repo that have the same structure.\n# - Your integration exist under custom_components/{INTEGRATION_NAME}/[integration files]\n# - You are using GitHub releases to publish new versions\n# - You have a INTEGRATION_VERSION constant in custom_components/{INTEGRATION_NAME}/const.py\n\nname: Release Workflow\n\non:\n  release:\n    types: [published]\n\njobs:\n  release:\n    name: Release\n    runs-on: ubuntu-latest\n    permissions:\n      contents: write\n      deployments: write\n    steps:\n      - name: 📥 Checkout the repository\n        uses: actions/checkout@v4\n\n      - name: 🔢 Get release version\n        id: version\n        uses: home-assistant/actions/helpers/version@master\n\n      - name: ℹ️ Get integration information\n        id: information\n        run: |\n          name=$(find custom_components/ -type d -maxdepth 1 | tail -n 1 | cut -d \"/\" -f2)\n          echo \"::set-output name=name::$name\"\n          min_ha_version=$(jq -r '.homeassistant' ${{ github.workspace }}/hacs.json)\n          echo \"::set-output name=min_ha_version::$min_ha_version\"\n\n      - name: 🖊️ Set version number\n        run: |\n          sed -i '/INTEGRATION_VERSION = /c\\INTEGRATION_VERSION = \"${{ steps.version.outputs.version }}\"' \\\n            \"${{ github.workspace }}/custom_components/${{ steps.information.outputs.name }}/const.py\"\n          jq '.version = \"${{ steps.version.outputs.version }}\"' \\\n            \"${{ github.workspace }}/custom_components/${{ steps.information.outputs.name }}/manifest.json\" > tmp \\\n            && mv -f tmp \"${{ github.workspace }}/custom_components/${{ steps.information.outputs.name }}/manifest.json\"\n\n      - name: 🖊️ Set min required HA version\n        run: |\n          sed -i '/MIN_REQUIRED_HA_VERSION = /c\\MIN_REQUIRED_HA_VERSION = \"${{ steps.information.outputs.min_ha_version }}\"' \\\n            \"${{ github.workspace }}/custom_components/${{ steps.information.outputs.name }}/const.py\"\n\n      - name: 👀 Validate data\n        run: |\n          echo \"Version found :${{ steps.version.outputs.version }}\";\n          if [[ '${{ steps.version.outputs.version }}' == '\"\"' ]]; then\n            echo \"Did not correctly identify version\"\n            exit 1\n          fi\n          if ! grep -q 'INTEGRATION_VERSION = \"${{ steps.version.outputs.version }}\"' ${{ github.workspace }}/custom_components/${{ steps.information.outputs.name }}/const.py; then\n            echo \"The version in custom_components/${{ steps.information.outputs.name }}/const.py was not correct\"\n            cat ${{ github.workspace }}/custom_components/${{ steps.information.outputs.name }}/const.py | grep INTEGRATION_VERSION\n            exit 1\n          fi\n          manifestversion=$(jq -r '.version' ${{ github.workspace }}/custom_components/${{ steps.information.outputs.name }}/manifest.json)\n          if [ \"$manifestversion\" != \"${{ steps.version.outputs.version }}\" ]; then\n            echo \"The version in custom_components/${{ steps.information.outputs.name }}/manifest.json was not correct\"\n            echo \"$manifestversion\"\n            exit 1\n          fi\n          if ! grep -q 'MIN_REQUIRED_HA_VERSION = \"${{ steps.information.outputs.min_ha_version }}\"' ${{ github.workspace }}/custom_components/${{ steps.information.outputs.name }}/const.py; then\n            echo \"The MIN_REQUIRED_HA_VERSION in custom_components/${{ steps.information.outputs.name }}/const.py was not correct\"\n            cat ${{ github.workspace }}/custom_components/${{ steps.information.outputs.name }}/const.py | grep MIN_REQUIRED_HA_VERSION\n            exit 1\n          fi\n\n      - name: 📦 Create zip file for the integration\n        run: |\n          cd \"${{ github.workspace }}/custom_components/${{ steps.information.outputs.name }}\"\n          zip ${{ steps.information.outputs.name }}.zip -r ./\n\n      - name: 📤 Upload the zip file as a release asset\n        uses: actions/upload-release-asset@v1\n        env:\n          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n        with:\n          upload_url: ${{ github.event.release.upload_url }}\n          asset_path: \"${{ github.workspace }}/custom_components/${{ steps.information.outputs.name }}/${{ steps.information.outputs.name }}.zip\"\n          asset_name: ${{ steps.information.outputs.name }}.zip\n          asset_content_type: application/zip\n"
  },
  {
    "path": ".github/workflows/stale.yml",
    "content": "name: \"Close stale issues\"\non:\n  schedule:\n    - cron: \"0 0 * * *\"\n  issue_comment:\n    types:\n      - created\n\njobs:\n  stale:\n    runs-on: ubuntu-latest\n    permissions:\n      issues: write\n    steps:\n      - uses: actions/stale@v9\n        with:\n          days-before-stale: 7\n          days-before-close: 7\n          days-before-pr-stale: -1\n          stale-issue-message: >\n            This issue has been automatically marked as stale because it has not had\n            recent activity. It will be closed if no further activity occurs. Thank you\n            for your contributions.\n          stale-issue-label: stale\n          only-labels: need-more-information\n"
  },
  {
    "path": ".gitignore",
    "content": "__pycache__\npythonenv*\nvenv\n.venv\n.coverage\n.idea\n.mypy_cache\n.pytest_cache\n/config\n"
  },
  {
    "path": ".pre-commit-config.yaml",
    "content": "ci:\n  skip:\n    - mypy\n    - pylint\n\ndefault_language_version:\n  python: python3.11\n\nrepos:\n  - repo: https://github.com/asottile/pyupgrade\n    rev: v3.15.0\n    hooks:\n      - id: pyupgrade\n        args: [--py311-plus]\n  - repo: https://github.com/psf/black\n    rev: 23.11.0\n    hooks:\n      - id: black\n        args:\n          - --quiet\n        <<: &python-files-with-tests\n          files: ^((custom_components|tests)/.+)?[^/]+\\.py$\n  - repo: https://github.com/codespell-project/codespell\n    rev: v2.2.6\n    hooks:\n      - id: codespell\n        args:\n          - --ignore-words-list=hass,deebot\n          - --skip=\"./.*,*.csv,*.json\"\n          - --quiet-level=2\n        exclude_types: [csv, json]\n  - repo: https://github.com/PyCQA/flake8\n    rev: 6.1.0\n    hooks:\n      - id: flake8\n        additional_dependencies:\n          - flake8-docstrings==1.6.0\n          - pydocstyle==6.1.1\n        <<: &python-files\n          files: ^(custom_components/.+)?[^/]+\\.py$\n  - repo: https://github.com/PyCQA/bandit\n    rev: 1.7.5\n    hooks:\n      - id: bandit\n        args:\n          - --quiet\n          - --format=custom\n          - --configfile=bandit.yaml\n        <<: *python-files-with-tests\n  - repo: https://github.com/PyCQA/isort\n    rev: 5.12.0\n    hooks:\n      - id: isort\n  - repo: https://github.com/pre-commit/pre-commit-hooks\n    rev: v4.5.0\n    hooks:\n      - id: check-executables-have-shebangs\n      - id: check-merge-conflict\n      - id: detect-private-key\n      - id: no-commit-to-branch\n        args:\n          - -b\n          - dev\n      - id: requirements-txt-fixer\n      - id: mixed-line-ending\n        args:\n          - --fix=lf\n        stages: [manual]\n      - id: pretty-format-json\n        args:\n          - --autofix\n          - --no-ensure-ascii\n          - --top-keys=domain,name\n        files: manifest\\.json$\n  - repo: https://github.com/pre-commit/mirrors-prettier\n    rev: v3.1.0\n    hooks:\n      - id: prettier\n        additional_dependencies:\n          - prettier@3.1.0\n          - prettier-plugin-sort-json@3.1.0\n        exclude_types:\n          - python\n        exclude: manifest\\.json$\n  - repo: https://github.com/adrienverge/yamllint.git\n    rev: v1.33.0\n    hooks:\n      - id: yamllint\n  - repo: local\n    hooks:\n      # Run mypy through our wrapper script in order to get the possible\n      # pyenv and/or virtualenv activated; it may not have been e.g. if\n      # committing from a GUI tool that was not launched from an activated\n      # shell.\n      - id: mypy\n        name: Check with mypy\n        entry: scripts/run-in-env.sh mypy\n        language: script\n        types: [python]\n        <<: *python-files\n      - id: pylint\n        name: Check with pylint\n        entry: scripts/run-in-env.sh pylint\n        language: script\n        types: [python]\n        <<: *python-files\n\n  - repo: https://github.com/pre-commit-ci/pre-commit-ci-config\n    rev: v1.6.1\n    hooks:\n      - id: check-pre-commit-ci-config\n\n  - repo: https://github.com/python-jsonschema/check-jsonschema\n    rev: 0.27.2\n    hooks:\n      - id: check-github-workflows\n      - id: check-dependabot\n      - id: check-jsonschema\n        name: Check translations files\n        files: ^custom_components/deebot/translations/\n        types:\n          - json\n        args:\n          - --schemafile\n          - translations.schema.json\n"
  },
  {
    "path": ".prettierrc.js",
    "content": "/** @type {import(\"prettier\").Config} */\nmodule.exports = {\n  plugins: [require.resolve(\"prettier-plugin-sort-json\")],\n  jsonRecursiveSort: true,\n};\n"
  },
  {
    "path": ".vscode/launch.json",
    "content": "// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387\n{\n  \"configurations\": [\n    {\n      \"host\": \"localhost\",\n      \"justMyCode\": false,\n      // Example of attaching to local debug server\n      \"name\": \"Python: Attach Local\",\n      \"pathMappings\": [\n        {\n          \"localRoot\": \"${workspaceFolder}\",\n          \"remoteRoot\": \".\"\n        }\n      ],\n      \"port\": 5678,\n      \"request\": \"attach\",\n      \"type\": \"python\"\n    },\n    {\n      \"host\": \"homeassistant.local\",\n      // Example of attaching to my production server\n      \"name\": \"Python: Attach Remote\",\n      \"pathMappings\": [\n        {\n          \"localRoot\": \"${workspaceFolder}\",\n          \"remoteRoot\": \"/usr/src/homeassistant\"\n        }\n      ],\n      \"port\": 5678,\n      \"request\": \"attach\",\n      \"type\": \"python\"\n    }\n  ],\n  \"version\": \"0.2.0\"\n}\n"
  },
  {
    "path": ".vscode/settings.json",
    "content": "{\n  \"files.associations\": {\n    \"*.yaml\": \"home-assistant\"\n  },\n  \"python.linting.enabled\": true,\n  \"python.linting.pylintEnabled\": true,\n  \"python.pythonPath\": \"/usr/local/bin/python\"\n}\n"
  },
  {
    "path": ".vscode/tasks.json",
    "content": "// See https://code.visualstudio.com/docs/editor/tasks\n{\n  \"tasks\": [\n    {\n      \"command\": \"scripts/develop\",\n      \"label\": \"Run Home Assistant\",\n      \"problemMatcher\": [],\n      \"type\": \"shell\"\n    },\n    {\n      \"command\": \"scripts/setup\",\n      \"label\": \"Upgrade environment\",\n      \"problemMatcher\": [],\n      \"type\": \"shell\"\n    },\n    {\n      \"command\": \"scripts/test\",\n      \"label\": \"Run tests\",\n      \"problemMatcher\": [],\n      \"type\": \"shell\"\n    },\n    {\n      \"command\": \"scripts/lint\",\n      \"label\": \"Run lint checks\",\n      \"problemMatcher\": [],\n      \"type\": \"shell\"\n    }\n  ],\n  \"version\": \"2.0.0\"\n}\n"
  },
  {
    "path": ".yamllint",
    "content": "rules:\n  braces:\n    level: error\n    min-spaces-inside: 0\n    max-spaces-inside: 1\n    min-spaces-inside-empty: -1\n    max-spaces-inside-empty: -1\n  brackets:\n    level: error\n    min-spaces-inside: 0\n    max-spaces-inside: 0\n    min-spaces-inside-empty: -1\n    max-spaces-inside-empty: -1\n  colons:\n    level: error\n    max-spaces-before: 0\n    max-spaces-after: 1\n  commas:\n    level: error\n    max-spaces-before: 0\n    min-spaces-after: 1\n    max-spaces-after: 1\n  comments:\n    level: error\n    require-starting-space: true\n    min-spaces-from-content: 2\n  comments-indentation:\n    level: error\n  document-end:\n    level: error\n    present: false\n  document-start:\n    level: error\n    present: false\n  empty-lines:\n    level: error\n    max: 1\n    max-start: 0\n    max-end: 1\n  hyphens:\n    level: error\n    max-spaces-after: 1\n  indentation:\n    level: error\n    spaces: 2\n    indent-sequences: true\n    check-multi-line-strings: false\n  key-duplicates:\n    level: error\n  line-length: disable\n  new-line-at-end-of-file:\n    level: error\n  new-lines:\n    level: error\n    type: unix\n  trailing-spaces:\n    level: error\n  truthy:\n    disable\n"
  },
  {
    "path": "CONTRIBUTING.md",
    "content": "# Contribution guidelines\n\nContributing to this project should be as easy and transparent as possible, whether it's:\n\n- Reporting a bug\n- Discussing the current state of the code\n- Submitting a fix\n- Proposing new features\n\n## Github is used for everything\n\nGithub is used to host code, to track issues and feature requests, as well as accept pull requests.\n\nPull requests are the best way to propose changes to the codebase.\n\n1. Fork the repo and create your branch from `dev`.\n2. Run `pip install -r requirements.txt` to install all requirements\n3. Run `pre-commit install --install-hooks` to setup up pre-commit (used for code quality checks)\n4. If you've changed something, update the documentation.\n5. Make sure your code lints (using pre-commit).\n6. Test you contribution.\n7. Issue that pull request!\n\n## Any contributions you make will be under project license\n\nIn short, when you submit code changes, your submissions are understood to be under the same [License](../LICENSE) that covers the project. Feel free to contact the maintainers if that's a concern.\n\n## Report bugs using Github's [issues](../../issues)\n\nGitHub issues are used to track public bugs.\nReport a bug by [opening a new issue](../../issues/new/choose); it's that easy!\n\n## Write bug reports with detail, background, and sample code\n\n**Great Bug Reports** tend to have:\n\n- A quick summary and/or background\n- Steps to reproduce\n  - Be specific!\n  - Give sample code if you can.\n- What you expected would happen\n- What actually happens\n- Notes (possibly including why you think this might be happening, or stuff you tried that didn't work)\n\nPeople _love_ thorough bug reports. I'm not even kidding.\n\n## Use a Consistent Coding Style\n\nUse [black](https://github.com/ambv/black) to make sure the code follows the style.\n\n## Test your code modification\n\nThis custom component is based on [integration_blueprint template](https://github.com/custom-components/integration_blueprint).\n\nIt comes with development environment in a container, easy to launch\nif you use Visual Studio Code. With this container you will have a stand alone\nHome Assistant instance running and already configured with the included\n[`.devcontainer/configuration.yaml`](./.devcontainer/configuration.yaml)\nfile.\n\n## License\n\nBy contributing, you agree that your contributions will be licensed under the projects License.\n"
  },
  {
    "path": "LICENSE",
    "content": "GNU GENERAL PUBLIC LICENSE\n                       Version 3, 29 June 2007\n\n Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>\n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n                            Preamble\n\n  The GNU General Public License is a free, copyleft license for\nsoftware and other kinds of works.\n\n  The licenses for most software and other practical works are designed\nto take away your freedom to share and change the works.  By contrast,\nthe GNU General Public License is intended to guarantee your freedom to\nshare and change all versions of a program--to make sure it remains free\nsoftware for all its users.  We, the Free Software Foundation, use the\nGNU General Public License for most of our software; it applies also to\nany other work released this way by its authors.  You can apply it to\nyour programs, too.\n\n  When we speak of free software, we are referring to freedom, not\nprice.  Our General Public Licenses are designed to make sure that you\nhave the freedom to distribute copies of free software (and charge for\nthem if you wish), that you receive source code or can get it if you\nwant it, that you can change the software or use pieces of it in new\nfree programs, and that you know you can do these things.\n\n  To protect your rights, we need to prevent others from denying you\nthese rights or asking you to surrender the rights.  Therefore, you have\ncertain responsibilities if you distribute copies of the software, or if\nyou modify it: responsibilities to respect the freedom of others.\n\n  For example, if you distribute copies of such a program, whether\ngratis or for a fee, you must pass on to the recipients the same\nfreedoms that you received.  You must make sure that they, too, receive\nor can get the source code.  And you must show them these terms so they\nknow their rights.\n\n  Developers that use the GNU GPL protect your rights with two steps:\n(1) assert copyright on the software, and (2) offer you this License\ngiving you legal permission to copy, distribute and/or modify it.\n\n  For the developers' and authors' protection, the GPL clearly explains\nthat there is no warranty for this free software.  For both users' and\nauthors' sake, the GPL requires that modified versions be marked as\nchanged, so that their problems will not be attributed erroneously to\nauthors of previous versions.\n\n  Some devices are designed to deny users access to install or run\nmodified versions of the software inside them, although the manufacturer\ncan do so.  This is fundamentally incompatible with the aim of\nprotecting users' freedom to change the software.  The systematic\npattern of such abuse occurs in the area of products for individuals to\nuse, which is precisely where it is most unacceptable.  Therefore, we\nhave designed this version of the GPL to prohibit the practice for those\nproducts.  If such problems arise substantially in other domains, we\nstand ready to extend this provision to those domains in future versions\nof the GPL, as needed to protect the freedom of users.\n\n  Finally, every program is threatened constantly by software patents.\nStates should not allow patents to restrict development and use of\nsoftware on general-purpose computers, but in those that do, we wish to\navoid the special danger that patents applied to a free program could\nmake it effectively proprietary.  To prevent this, the GPL assures that\npatents cannot be used to render the program non-free.\n\n  The precise terms and conditions for copying, distribution and\nmodification follow.\n\n                       TERMS AND CONDITIONS\n\n  0. Definitions.\n\n  \"This License\" refers to version 3 of the GNU General Public License.\n\n  \"Copyright\" also means copyright-like laws that apply to other kinds of\nworks, such as semiconductor masks.\n\n  \"The Program\" refers to any copyrightable work licensed under this\nLicense.  Each licensee is addressed as \"you\".  \"Licensees\" and\n\"recipients\" may be individuals or organizations.\n\n  To \"modify\" a work means to copy from or adapt all or part of the work\nin a fashion requiring copyright permission, other than the making of an\nexact copy.  The resulting work is called a \"modified version\" of the\nearlier work or a work \"based on\" the earlier work.\n\n  A \"covered work\" means either the unmodified Program or a work based\non the Program.\n\n  To \"propagate\" a work means to do anything with it that, without\npermission, would make you directly or secondarily liable for\ninfringement under applicable copyright law, except executing it on a\ncomputer or modifying a private copy.  Propagation includes copying,\ndistribution (with or without modification), making available to the\npublic, and in some countries other activities as well.\n\n  To \"convey\" a work means any kind of propagation that enables other\nparties to make or receive copies.  Mere interaction with a user through\na computer network, with no transfer of a copy, is not conveying.\n\n  An interactive user interface displays \"Appropriate Legal Notices\"\nto the extent that it includes a convenient and prominently visible\nfeature that (1) displays an appropriate copyright notice, and (2)\ntells the user that there is no warranty for the work (except to the\nextent that warranties are provided), that licensees may convey the\nwork under this License, and how to view a copy of this License.  If\nthe interface presents a list of user commands or options, such as a\nmenu, a prominent item in the list meets this criterion.\n\n  1. Source Code.\n\n  The \"source code\" for a work means the preferred form of the work\nfor making modifications to it.  \"Object code\" means any non-source\nform of a work.\n\n  A \"Standard Interface\" means an interface that either is an official\nstandard defined by a recognized standards body, or, in the case of\ninterfaces specified for a particular programming language, one that\nis widely used among developers working in that language.\n\n  The \"System Libraries\" of an executable work include anything, other\nthan the work as a whole, that (a) is included in the normal form of\npackaging a Major Component, but which is not part of that Major\nComponent, and (b) serves only to enable use of the work with that\nMajor Component, or to implement a Standard Interface for which an\nimplementation is available to the public in source code form.  A\n\"Major Component\", in this context, means a major essential component\n(kernel, window system, and so on) of the specific operating system\n(if any) on which the executable work runs, or a compiler used to\nproduce the work, or an object code interpreter used to run it.\n\n  The \"Corresponding Source\" for a work in object code form means all\nthe source code needed to generate, install, and (for an executable\nwork) run the object code and to modify the work, including scripts to\ncontrol those activities.  However, it does not include the work's\nSystem Libraries, or general-purpose tools or generally available free\nprograms which are used unmodified in performing those activities but\nwhich are not part of the work.  For example, Corresponding Source\nincludes interface definition files associated with source files for\nthe work, and the source code for shared libraries and dynamically\nlinked subprograms that the work is specifically designed to require,\nsuch as by intimate data communication or control flow between those\nsubprograms and other parts of the work.\n\n  The Corresponding Source need not include anything that users\ncan regenerate automatically from other parts of the Corresponding\nSource.\n\n  The Corresponding Source for a work in source code form is that\nsame work.\n\n  2. Basic Permissions.\n\n  All rights granted under this License are granted for the term of\ncopyright on the Program, and are irrevocable provided the stated\nconditions are met.  This License explicitly affirms your unlimited\npermission to run the unmodified Program.  The output from running a\ncovered work is covered by this License only if the output, given its\ncontent, constitutes a covered work.  This License acknowledges your\nrights of fair use or other equivalent, as provided by copyright law.\n\n  You may make, run and propagate covered works that you do not\nconvey, without conditions so long as your license otherwise remains\nin force.  You may convey covered works to others for the sole purpose\nof having them make modifications exclusively for you, or provide you\nwith facilities for running those works, provided that you comply with\nthe terms of this License in conveying all material for which you do\nnot control copyright.  Those thus making or running the covered works\nfor you must do so exclusively on your behalf, under your direction\nand control, on terms that prohibit them from making any copies of\nyour copyrighted material outside their relationship with you.\n\n  Conveying under any other circumstances is permitted solely under\nthe conditions stated below.  Sublicensing is not allowed; section 10\nmakes it unnecessary.\n\n  3. Protecting Users' Legal Rights From Anti-Circumvention Law.\n\n  No covered work shall be deemed part of an effective technological\nmeasure under any applicable law fulfilling obligations under article\n11 of the WIPO copyright treaty adopted on 20 December 1996, or\nsimilar laws prohibiting or restricting circumvention of such\nmeasures.\n\n  When you convey a covered work, you waive any legal power to forbid\ncircumvention of technological measures to the extent such circumvention\nis effected by exercising rights under this License with respect to\nthe covered work, and you disclaim any intention to limit operation or\nmodification of the work as a means of enforcing, against the work's\nusers, your or third parties' legal rights to forbid circumvention of\ntechnological measures.\n\n  4. Conveying Verbatim Copies.\n\n  You may convey verbatim copies of the Program's source code as you\nreceive it, in any medium, provided that you conspicuously and\nappropriately publish on each copy an appropriate copyright notice;\nkeep intact all notices stating that this License and any\nnon-permissive terms added in accord with section 7 apply to the code;\nkeep intact all notices of the absence of any warranty; and give all\nrecipients a copy of this License along with the Program.\n\n  You may charge any price or no price for each copy that you convey,\nand you may offer support or warranty protection for a fee.\n\n  5. Conveying Modified Source Versions.\n\n  You may convey a work based on the Program, or the modifications to\nproduce it from the Program, in the form of source code under the\nterms of section 4, provided that you also meet all of these conditions:\n\n    a) The work must carry prominent notices stating that you modified\n    it, and giving a relevant date.\n\n    b) The work must carry prominent notices stating that it is\n    released under this License and any conditions added under section\n    7.  This requirement modifies the requirement in section 4 to\n    \"keep intact all notices\".\n\n    c) You must license the entire work, as a whole, under this\n    License to anyone who comes into possession of a copy.  This\n    License will therefore apply, along with any applicable section 7\n    additional terms, to the whole of the work, and all its parts,\n    regardless of how they are packaged.  This License gives no\n    permission to license the work in any other way, but it does not\n    invalidate such permission if you have separately received it.\n\n    d) If the work has interactive user interfaces, each must display\n    Appropriate Legal Notices; however, if the Program has interactive\n    interfaces that do not display Appropriate Legal Notices, your\n    work need not make them do so.\n\n  A compilation of a covered work with other separate and independent\nworks, which are not by their nature extensions of the covered work,\nand which are not combined with it such as to form a larger program,\nin or on a volume of a storage or distribution medium, is called an\n\"aggregate\" if the compilation and its resulting copyright are not\nused to limit the access or legal rights of the compilation's users\nbeyond what the individual works permit.  Inclusion of a covered work\nin an aggregate does not cause this License to apply to the other\nparts of the aggregate.\n\n  6. Conveying Non-Source Forms.\n\n  You may convey a covered work in object code form under the terms\nof sections 4 and 5, provided that you also convey the\nmachine-readable Corresponding Source under the terms of this License,\nin one of these ways:\n\n    a) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by the\n    Corresponding Source fixed on a durable physical medium\n    customarily used for software interchange.\n\n    b) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by a\n    written offer, valid for at least three years and valid for as\n    long as you offer spare parts or customer support for that product\n    model, to give anyone who possesses the object code either (1) a\n    copy of the Corresponding Source for all the software in the\n    product that is covered by this License, on a durable physical\n    medium customarily used for software interchange, for a price no\n    more than your reasonable cost of physically performing this\n    conveying of source, or (2) access to copy the\n    Corresponding Source from a network server at no charge.\n\n    c) Convey individual copies of the object code with a copy of the\n    written offer to provide the Corresponding Source.  This\n    alternative is allowed only occasionally and noncommercially, and\n    only if you received the object code with such an offer, in accord\n    with subsection 6b.\n\n    d) Convey the object code by offering access from a designated\n    place (gratis or for a charge), and offer equivalent access to the\n    Corresponding Source in the same way through the same place at no\n    further charge.  You need not require recipients to copy the\n    Corresponding Source along with the object code.  If the place to\n    copy the object code is a network server, the Corresponding Source\n    may be on a different server (operated by you or a third party)\n    that supports equivalent copying facilities, provided you maintain\n    clear directions next to the object code saying where to find the\n    Corresponding Source.  Regardless of what server hosts the\n    Corresponding Source, you remain obligated to ensure that it is\n    available for as long as needed to satisfy these requirements.\n\n    e) Convey the object code using peer-to-peer transmission, provided\n    you inform other peers where the object code and Corresponding\n    Source of the work are being offered to the general public at no\n    charge under subsection 6d.\n\n  A separable portion of the object code, whose source code is excluded\nfrom the Corresponding Source as a System Library, need not be\nincluded in conveying the object code work.\n\n  A \"User Product\" is either (1) a \"consumer product\", which means any\ntangible personal property which is normally used for personal, family,\nor household purposes, or (2) anything designed or sold for incorporation\ninto a dwelling.  In determining whether a product is a consumer product,\ndoubtful cases shall be resolved in favor of coverage.  For a particular\nproduct received by a particular user, \"normally used\" refers to a\ntypical or common use of that class of product, regardless of the status\nof the particular user or of the way in which the particular user\nactually uses, or expects or is expected to use, the product.  A product\nis a consumer product regardless of whether the product has substantial\ncommercial, industrial or non-consumer uses, unless such uses represent\nthe only significant mode of use of the product.\n\n  \"Installation Information\" for a User Product means any methods,\nprocedures, authorization keys, or other information required to install\nand execute modified versions of a covered work in that User Product from\na modified version of its Corresponding Source.  The information must\nsuffice to ensure that the continued functioning of the modified object\ncode is in no case prevented or interfered with solely because\nmodification has been made.\n\n  If you convey an object code work under this section in, or with, or\nspecifically for use in, a User Product, and the conveying occurs as\npart of a transaction in which the right of possession and use of the\nUser Product is transferred to the recipient in perpetuity or for a\nfixed term (regardless of how the transaction is characterized), the\nCorresponding Source conveyed under this section must be accompanied\nby the Installation Information.  But this requirement does not apply\nif neither you nor any third party retains the ability to install\nmodified object code on the User Product (for example, the work has\nbeen installed in ROM).\n\n  The requirement to provide Installation Information does not include a\nrequirement to continue to provide support service, warranty, or updates\nfor a work that has been modified or installed by the recipient, or for\nthe User Product in which it has been modified or installed.  Access to a\nnetwork may be denied when the modification itself materially and\nadversely affects the operation of the network or violates the rules and\nprotocols for communication across the network.\n\n  Corresponding Source conveyed, and Installation Information provided,\nin accord with this section must be in a format that is publicly\ndocumented (and with an implementation available to the public in\nsource code form), and must require no special password or key for\nunpacking, reading or copying.\n\n  7. Additional Terms.\n\n  \"Additional permissions\" are terms that supplement the terms of this\nLicense by making exceptions from one or more of its conditions.\nAdditional permissions that are applicable to the entire Program shall\nbe treated as though they were included in this License, to the extent\nthat they are valid under applicable law.  If additional permissions\napply only to part of the Program, that part may be used separately\nunder those permissions, but the entire Program remains governed by\nthis License without regard to the additional permissions.\n\n  When you convey a copy of a covered work, you may at your option\nremove any additional permissions from that copy, or from any part of\nit.  (Additional permissions may be written to require their own\nremoval in certain cases when you modify the work.)  You may place\nadditional permissions on material, added by you to a covered work,\nfor which you have or can give appropriate copyright permission.\n\n  Notwithstanding any other provision of this License, for material you\nadd to a covered work, you may (if authorized by the copyright holders of\nthat material) supplement the terms of this License with terms:\n\n    a) Disclaiming warranty or limiting liability differently from the\n    terms of sections 15 and 16 of this License; or\n\n    b) Requiring preservation of specified reasonable legal notices or\n    author attributions in that material or in the Appropriate Legal\n    Notices displayed by works containing it; or\n\n    c) Prohibiting misrepresentation of the origin of that material, or\n    requiring that modified versions of such material be marked in\n    reasonable ways as different from the original version; or\n\n    d) Limiting the use for publicity purposes of names of licensors or\n    authors of the material; or\n\n    e) Declining to grant rights under trademark law for use of some\n    trade names, trademarks, or service marks; or\n\n    f) Requiring indemnification of licensors and authors of that\n    material by anyone who conveys the material (or modified versions of\n    it) with contractual assumptions of liability to the recipient, for\n    any liability that these contractual assumptions directly impose on\n    those licensors and authors.\n\n  All other non-permissive additional terms are considered \"further\nrestrictions\" within the meaning of section 10.  If the Program as you\nreceived it, or any part of it, contains a notice stating that it is\ngoverned by this License along with a term that is a further\nrestriction, you may remove that term.  If a license document contains\na further restriction but permits relicensing or conveying under this\nLicense, you may add to a covered work material governed by the terms\nof that license document, provided that the further restriction does\nnot survive such relicensing or conveying.\n\n  If you add terms to a covered work in accord with this section, you\nmust place, in the relevant source files, a statement of the\nadditional terms that apply to those files, or a notice indicating\nwhere to find the applicable terms.\n\n  Additional terms, permissive or non-permissive, may be stated in the\nform of a separately written license, or stated as exceptions;\nthe above requirements apply either way.\n\n  8. Termination.\n\n  You may not propagate or modify a covered work except as expressly\nprovided under this License.  Any attempt otherwise to propagate or\nmodify it is void, and will automatically terminate your rights under\nthis License (including any patent licenses granted under the third\nparagraph of section 11).\n\n  However, if you cease all violation of this License, then your\nlicense from a particular copyright holder is reinstated (a)\nprovisionally, unless and until the copyright holder explicitly and\nfinally terminates your license, and (b) permanently, if the copyright\nholder fails to notify you of the violation by some reasonable means\nprior to 60 days after the cessation.\n\n  Moreover, your license from a particular copyright holder is\nreinstated permanently if the copyright holder notifies you of the\nviolation by some reasonable means, this is the first time you have\nreceived notice of violation of this License (for any work) from that\ncopyright holder, and you cure the violation prior to 30 days after\nyour receipt of the notice.\n\n  Termination of your rights under this section does not terminate the\nlicenses of parties who have received copies or rights from you under\nthis License.  If your rights have been terminated and not permanently\nreinstated, you do not qualify to receive new licenses for the same\nmaterial under section 10.\n\n  9. Acceptance Not Required for Having Copies.\n\n  You are not required to accept this License in order to receive or\nrun a copy of the Program.  Ancillary propagation of a covered work\noccurring solely as a consequence of using peer-to-peer transmission\nto receive a copy likewise does not require acceptance.  However,\nnothing other than this License grants you permission to propagate or\nmodify any covered work.  These actions infringe copyright if you do\nnot accept this License.  Therefore, by modifying or propagating a\ncovered work, you indicate your acceptance of this License to do so.\n\n  10. Automatic Licensing of Downstream Recipients.\n\n  Each time you convey a covered work, the recipient automatically\nreceives a license from the original licensors, to run, modify and\npropagate that work, subject to this License.  You are not responsible\nfor enforcing compliance by third parties with this License.\n\n  An \"entity transaction\" is a transaction transferring control of an\norganization, or substantially all assets of one, or subdividing an\norganization, or merging organizations.  If propagation of a covered\nwork results from an entity transaction, each party to that\ntransaction who receives a copy of the work also receives whatever\nlicenses to the work the party's predecessor in interest had or could\ngive under the previous paragraph, plus a right to possession of the\nCorresponding Source of the work from the predecessor in interest, if\nthe predecessor has it or can get it with reasonable efforts.\n\n  You may not impose any further restrictions on the exercise of the\nrights granted or affirmed under this License.  For example, you may\nnot impose a license fee, royalty, or other charge for exercise of\nrights granted under this License, and you may not initiate litigation\n(including a cross-claim or counterclaim in a lawsuit) alleging that\nany patent claim is infringed by making, using, selling, offering for\nsale, or importing the Program or any portion of it.\n\n  11. Patents.\n\n  A \"contributor\" is a copyright holder who authorizes use under this\nLicense of the Program or a work on which the Program is based.  The\nwork thus licensed is called the contributor's \"contributor version\".\n\n  A contributor's \"essential patent claims\" are all patent claims\nowned or controlled by the contributor, whether already acquired or\nhereafter acquired, that would be infringed by some manner, permitted\nby this License, of making, using, or selling its contributor version,\nbut do not include claims that would be infringed only as a\nconsequence of further modification of the contributor version.  For\npurposes of this definition, \"control\" includes the right to grant\npatent sublicenses in a manner consistent with the requirements of\nthis License.\n\n  Each contributor grants you a non-exclusive, worldwide, royalty-free\npatent license under the contributor's essential patent claims, to\nmake, use, sell, offer for sale, import and otherwise run, modify and\npropagate the contents of its contributor version.\n\n  In the following three paragraphs, a \"patent license\" is any express\nagreement or commitment, however denominated, not to enforce a patent\n(such as an express permission to practice a patent or covenant not to\nsue for patent infringement).  To \"grant\" such a patent license to a\nparty means to make such an agreement or commitment not to enforce a\npatent against the party.\n\n  If you convey a covered work, knowingly relying on a patent license,\nand the Corresponding Source of the work is not available for anyone\nto copy, free of charge and under the terms of this License, through a\npublicly available network server or other readily accessible means,\nthen you must either (1) cause the Corresponding Source to be so\navailable, or (2) arrange to deprive yourself of the benefit of the\npatent license for this particular work, or (3) arrange, in a manner\nconsistent with the requirements of this License, to extend the patent\nlicense to downstream recipients.  \"Knowingly relying\" means you have\nactual knowledge that, but for the patent license, your conveying the\ncovered work in a country, or your recipient's use of the covered work\nin a country, would infringe one or more identifiable patents in that\ncountry that you have reason to believe are valid.\n\n  If, pursuant to or in connection with a single transaction or\narrangement, you convey, or propagate by procuring conveyance of, a\ncovered work, and grant a patent license to some of the parties\nreceiving the covered work authorizing them to use, propagate, modify\nor convey a specific copy of the covered work, then the patent license\nyou grant is automatically extended to all recipients of the covered\nwork and works based on it.\n\n  A patent license is \"discriminatory\" if it does not include within\nthe scope of its coverage, prohibits the exercise of, or is\nconditioned on the non-exercise of one or more of the rights that are\nspecifically granted under this License.  You may not convey a covered\nwork if you are a party to an arrangement with a third party that is\nin the business of distributing software, under which you make payment\nto the third party based on the extent of your activity of conveying\nthe work, and under which the third party grants, to any of the\nparties who would receive the covered work from you, a discriminatory\npatent license (a) in connection with copies of the covered work\nconveyed by you (or copies made from those copies), or (b) primarily\nfor and in connection with specific products or compilations that\ncontain the covered work, unless you entered into that arrangement,\nor that patent license was granted, prior to 28 March 2007.\n\n  Nothing in this License shall be construed as excluding or limiting\nany implied license or other defenses to infringement that may\notherwise be available to you under applicable patent law.\n\n  12. No Surrender of Others' Freedom.\n\n  If conditions are imposed on you (whether by court order, agreement or\notherwise) that contradict the conditions of this License, they do not\nexcuse you from the conditions of this License.  If you cannot convey a\ncovered work so as to satisfy simultaneously your obligations under this\nLicense and any other pertinent obligations, then as a consequence you may\nnot convey it at all.  For example, if you agree to terms that obligate you\nto collect a royalty for further conveying from those to whom you convey\nthe Program, the only way you could satisfy both those terms and this\nLicense would be to refrain entirely from conveying the Program.\n\n  13. Use with the GNU Affero General Public License.\n\n  Notwithstanding any other provision of this License, you have\npermission to link or combine any covered work with a work licensed\nunder version 3 of the GNU Affero General Public License into a single\ncombined work, and to convey the resulting work.  The terms of this\nLicense will continue to apply to the part which is the covered work,\nbut the special requirements of the GNU Affero General Public License,\nsection 13, concerning interaction through a network will apply to the\ncombination as such.\n\n  14. Revised Versions of this License.\n\n  The Free Software Foundation may publish revised and/or new versions of\nthe GNU General Public License from time to time.  Such new versions will\nbe similar in spirit to the present version, but may differ in detail to\naddress new problems or concerns.\n\n  Each version is given a distinguishing version number.  If the\nProgram specifies that a certain numbered version of the GNU General\nPublic License \"or any later version\" applies to it, you have the\noption of following the terms and conditions either of that numbered\nversion or of any later version published by the Free Software\nFoundation.  If the Program does not specify a version number of the\nGNU General Public License, you may choose any version ever published\nby the Free Software Foundation.\n\n  If the Program specifies that a proxy can decide which future\nversions of the GNU General Public License can be used, that proxy's\npublic statement of acceptance of a version permanently authorizes you\nto choose that version for the Program.\n\n  Later license versions may give you additional or different\npermissions.  However, no additional obligations are imposed on any\nauthor or copyright holder as a result of your choosing to follow a\nlater version.\n\n  15. Disclaimer of Warranty.\n\n  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY\nAPPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT\nHOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY\nOF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,\nTHE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\nPURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM\nIS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF\nALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n\n  16. Limitation of Liability.\n\n  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\nWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS\nTHE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY\nGENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE\nUSE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF\nDATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD\nPARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),\nEVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF\nSUCH DAMAGES.\n\n  17. Interpretation of Sections 15 and 16.\n\n  If the disclaimer of warranty and limitation of liability provided\nabove cannot be given local legal effect according to their terms,\nreviewing courts shall apply local law that most closely approximates\nan absolute waiver of all civil liability in connection with the\nProgram, unless a warranty or assumption of liability accompanies a\ncopy of the Program in return for a fee.\n\n                     END OF TERMS AND CONDITIONS\n\n            How to Apply These Terms to Your New Programs\n\n  If you develop a new program, and you want it to be of the greatest\npossible use to the public, the best way to achieve this is to make it\nfree software which everyone can redistribute and change under these terms.\n\n  To do so, attach the following notices to the program.  It is safest\nto attach them to the start of each source file to most effectively\nstate the exclusion of warranty; and each file should have at least\nthe \"copyright\" line and a pointer to where the full notice is found.\n\n    <one line to give the program's name and a brief idea of what it does.>\n    Copyright (C) <year>  <name of author>\n\n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with this program.  If not, see <https://www.gnu.org/licenses/>.\n\nAlso add information on how to contact you by electronic and paper mail.\n\n  If the program does terminal interaction, make it output a short\nnotice like this when it starts in an interactive mode:\n\n    <program>  Copyright (C) <year>  <name of author>\n    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.\n    This is free software, and you are welcome to redistribute it\n    under certain conditions; type `show c' for details.\n\nThe hypothetical commands `show w' and `show c' should show the appropriate\nparts of the General Public License.  Of course, your program's commands\nmight be different; for a GUI interface, you would use an \"about box\".\n\n  You should also get your employer (if you work as a programmer) or school,\nif any, to sign a \"copyright disclaimer\" for the program, if necessary.\nFor more information on this, and how to apply and follow the GNU GPL, see\n<https://www.gnu.org/licenses/>.\n\n  The GNU General Public License does not permit incorporating your program\ninto proprietary programs.  If your program is a subroutine library, you\nmay consider it more useful to permit linking proprietary applications with\nthe library.  If this is what you want to do, use the GNU Lesser General\nPublic License instead of this License.  But first, please read\n<https://www.gnu.org/licenses/why-not-lgpl.html>.\n"
  },
  {
    "path": "README.md",
    "content": "# Home Assistant integration for deebot vacuums\n\n<a href=\"https://www.buymeacoffee.com/edenhaus\" target=\"_blank\"><img src=\"https://cdn.buymeacoffee.com/buttons/default-black.png\" width=\"150px\" height=\"28px\" alt=\"Buy Me A Coffee\" style=\"height: 28px !important;width: 150px !important;\" ></a>\n\n**This integration has been available directly in the Home Assistant core since version `2024.2.0`. For more information, please check out the [Ecovacs HA documentation](https://www.home-assistant.io/integrations/ecovacs/).**\n\nWith this custom component you'll be able to\n\n- play/pause\n- locate\n- send to home\n- clean[auto|map|area]\n- track live map\n- sensors\n- and much more...\n\n## Useful links\n\n- [Documentation](https://deebot.readthedocs.io/integrations/home-assistant/)\n- [FAQ](https://deebot.readthedocs.io/home/faq/)\n- [GitHub](https://github.com/DeebotUniverse/Deebot-4-Home-Assistant)\n- [BuyMe~~Coffee~~Beer? 🍺🙈](https://buymeacoffee.com/edenhaus)\n\n## Thanks\n\nMy heartfelt thanks to:\n\n- [Deebot-for-Home-Assistant](https://github.com/And3rsL/Deebot-for-Home-Assistant), After all, this is a Deebot-for-Home-Assistant fork :)\n- [integration template](https://github.com/custom-components/integration_blueprint), a template for HA integrations\n"
  },
  {
    "path": "bandit.yaml",
    "content": "# https://bandit.readthedocs.io/en/latest/config.html\n\ntests:\n  - B103\n  - B108\n  - B306\n  - B307\n  - B313\n  - B314\n  - B315\n  - B316\n  - B317\n  - B318\n  - B319\n  - B320\n  - B601\n  - B602\n  - B604\n  - B608\n  - B609\n"
  },
  {
    "path": "custom_components/__init__.py",
    "content": "\"\"\"Custom components module.\"\"\"\n"
  },
  {
    "path": "custom_components/deebot/__init__.py",
    "content": "\"\"\"Support for Deebot Vacuums.\"\"\"\nimport asyncio\nimport logging\nfrom typing import Any\n\nfrom awesomeversion import AwesomeVersion\nfrom homeassistant.config_entries import ConfigEntry\nfrom homeassistant.const import CONF_DEVICES, CONF_USERNAME, CONF_VERIFY_SSL, Platform\nfrom homeassistant.const import __version__ as HA_VERSION\nfrom homeassistant.core import HomeAssistant\nfrom homeassistant.helpers.issue_registry import (\n    IssueSeverity,\n    async_create_issue,\n    async_delete_issue,\n)\n\nfrom custom_components.deebot.controller import DeebotController\n\nfrom .const import (\n    CONF_BUMPER,\n    CONF_CLIENT_DEVICE_ID,\n    DOMAIN,\n    INTEGRATION_VERSION,\n    MIN_REQUIRED_HA_VERSION,\n    STARTUP_MESSAGE,\n)\nfrom .util import get_bumper_device_id\n\n_LOGGER = logging.getLogger(__name__)\n\nPLATFORMS = [\n    Platform.BINARY_SENSOR,\n    Platform.BUTTON,\n    Platform.IMAGE,\n    Platform.NUMBER,\n    Platform.SELECT,\n    Platform.SENSOR,\n    Platform.SWITCH,\n    Platform.VACUUM,\n]\n\n\ndef is_ha_supported() -> bool:\n    \"\"\"Return True, if current HA version is supported.\"\"\"\n    if AwesomeVersion(HA_VERSION) >= MIN_REQUIRED_HA_VERSION:\n        return True\n\n    _LOGGER.error(\n        'Unsupported HA version! Please upgrade home assistant at least to \"%s\"',\n        MIN_REQUIRED_HA_VERSION,\n    )\n    return False\n\n\nasync def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:\n    \"\"\"Set up this integration using UI.\"\"\"\n\n    if DOMAIN not in hass.data:\n        # Print startup message\n        _LOGGER.info(STARTUP_MESSAGE)\n\n    if not is_ha_supported():\n        return False\n\n    if INTEGRATION_VERSION == \"main\":\n        _LOGGER.warning(\"Beta-Version! Use this version only for testing.\")\n\n    if AwesomeVersion(HA_VERSION) >= \"2024.2.0b0\":\n        async_create_issue(\n            hass,\n            DOMAIN,\n            \"deprecated_integration_issue\",\n            is_fixable=False,\n            issue_domain=DOMAIN,\n            severity=IssueSeverity.WARNING,\n            translation_key=\"deprecated_integration_issue\",\n            translation_placeholders={\n                \"config_url\": \"/config/integrations/dashboard/add?domain=ecovacs\",\n                \"docs_url\": \"https://www.home-assistant.io/integrations/ecovacs/\",\n            },\n        )\n\n    # Store an instance of the \"connecting\" class that does the work of speaking\n    # with your actual devices.\n    controller = DeebotController(hass, {**entry.data, **entry.options})\n    await controller.initialize()\n\n    hass.data.setdefault(DOMAIN, {})[entry.entry_id] = controller\n    await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)\n    # Reload entry when its updated.\n    entry.async_on_unload(entry.add_update_listener(async_reload_entry))\n    return True\n\n\nasync def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:\n    \"\"\"Unload a config entry.\"\"\"\n    # This is called when an entry/configured device is to be removed. The class\n    # needs to unload itself, and remove callbacks. See the classes for further\n    # details\n    unload_ok = all(\n        await asyncio.gather(\n            *[\n                hass.config_entries.async_forward_entry_unload(entry, component)\n                for component in PLATFORMS\n            ]\n        )\n    )\n\n    if unload_ok:\n        await hass.data[DOMAIN][entry.entry_id].teardown()\n        hass.data[DOMAIN].pop(entry.entry_id)\n        if len(hass.data[DOMAIN]) == 0:\n            hass.data.pop(DOMAIN)\n            async_delete_issue(\n                hass,\n                DOMAIN,\n                \"deprecated_integration_issue\",\n            )\n\n    return unload_ok\n\n\nasync def async_reload_entry(hass: HomeAssistant, entry: ConfigEntry) -> None:\n    \"\"\"Reload the config entry when it changed.\"\"\"\n    await hass.config_entries.async_reload(entry.entry_id)\n\n\nasync def async_migrate_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> bool:\n    \"\"\"Migrate old entry.\"\"\"\n    _LOGGER.debug(\"Migrating from version %d\", config_entry.version)\n\n    if config_entry.version == 1:\n        new: dict[str, Any] = {**config_entry.data, CONF_VERIFY_SSL: True}\n\n        device_id = \"deviceid\"\n        devices = new.pop(device_id, {})\n        new.pop(\"show_color_rooms\")\n        new.pop(\"live_map\")\n\n        new[CONF_DEVICES] = devices.get(device_id, [])\n\n        config_entry.data = {**new}\n        config_entry.version = 2\n\n    if config_entry.version == 2:\n        new = {**config_entry.data}\n\n        if new.get(CONF_USERNAME) == CONF_BUMPER:\n            new[CONF_CLIENT_DEVICE_ID] = get_bumper_device_id(hass)\n\n        config_entry.data = {**new}\n        config_entry.version = 3\n\n    if config_entry.version == 3:\n        new = {**config_entry.data}\n\n        devices = new.pop(CONF_DEVICES)\n\n        config_entry.data = {**new}\n        config_entry.options = {CONF_DEVICES: devices}\n        config_entry.version = 4\n\n    _LOGGER.info(\"Migration to version %d successful\", config_entry.version)\n\n    return True\n"
  },
  {
    "path": "custom_components/deebot/binary_sensor.py",
    "content": "\"\"\"Binary sensor module.\"\"\"\nfrom collections.abc import Callable\nfrom dataclasses import dataclass\nfrom typing import Generic\n\nfrom deebot_client.capabilities import CapabilityEvent\nfrom deebot_client.events.water_info import WaterInfoEvent\nfrom homeassistant.components.binary_sensor import (\n    BinarySensorEntity,\n    BinarySensorEntityDescription,\n)\nfrom homeassistant.config_entries import ConfigEntry\nfrom homeassistant.core import HomeAssistant\nfrom homeassistant.helpers.entity import EntityCategory\nfrom homeassistant.helpers.entity_platform import AddEntitiesCallback\n\nfrom .const import DOMAIN\nfrom .controller import DeebotController\nfrom .entity import DeebotEntity, DeebotEntityDescription, EventT\n\n\n@dataclass(kw_only=True, frozen=True)\nclass DeebotBinarySensorEntityDescription(\n    BinarySensorEntityDescription,  # type: ignore\n    DeebotEntityDescription,\n    Generic[EventT],\n):\n    \"\"\"Class describing Deebot binary sensor entity.\"\"\"\n\n    value_fn: Callable[[EventT], bool | None]\n    icon_fn: Callable[[bool | None], str | None]\n\n\nENTITY_DESCRIPTIONS: tuple[DeebotBinarySensorEntityDescription, ...] = (\n    DeebotBinarySensorEntityDescription[WaterInfoEvent](\n        capability_fn=lambda caps: caps.water,\n        value_fn=lambda e: e.mop_attached,\n        icon_fn=lambda is_on: \"mdi:water\" if is_on else \"mdi:water-off\",\n        key=\"mop_attached\",\n        translation_key=\"mop_attached\",\n        entity_registry_enabled_default=False,\n        entity_category=EntityCategory.DIAGNOSTIC,\n    ),\n)\n\n\nasync def async_setup_entry(\n    hass: HomeAssistant,\n    config_entry: ConfigEntry,\n    async_add_entities: AddEntitiesCallback,\n) -> None:\n    \"\"\"Add entities for passed config_entry in HA.\"\"\"\n    controller: DeebotController = hass.data[DOMAIN][config_entry.entry_id]\n    controller.register_platform_add_entities(\n        DeebotBinarySensor, ENTITY_DESCRIPTIONS, async_add_entities\n    )\n\n\nclass DeebotBinarySensor(DeebotEntity[CapabilityEvent[EventT], DeebotBinarySensorEntityDescription], BinarySensorEntity):  # type: ignore\n    \"\"\"Deebot binary sensor.\"\"\"\n\n    async def async_added_to_hass(self) -> None:\n        \"\"\"Set up the event listeners now that hass is ready.\"\"\"\n        await super().async_added_to_hass()\n\n        async def on_event(event: EventT) -> None:\n            self._attr_is_on = self.entity_description.value_fn(event)\n            self._attr_icon = self.entity_description.icon_fn(self._attr_is_on)\n            self.async_write_ha_state()\n\n        self._subscribe(self._capability.event, on_event)\n"
  },
  {
    "path": "custom_components/deebot/button.py",
    "content": "\"\"\"Binary sensor module.\"\"\"\nfrom collections.abc import Sequence\nfrom dataclasses import dataclass\n\nfrom deebot_client.capabilities import CapabilityExecute\nfrom deebot_client.device import Device\nfrom deebot_client.events import LifeSpan\nfrom homeassistant.components.button import ButtonEntity, ButtonEntityDescription\nfrom homeassistant.config_entries import ConfigEntry\nfrom homeassistant.core import HomeAssistant\nfrom homeassistant.helpers.entity import EntityCategory\nfrom homeassistant.helpers.entity_platform import AddEntitiesCallback\n\nfrom .const import DOMAIN\nfrom .controller import DeebotController\nfrom .entity import DeebotEntity, DeebotEntityDescription\n\n\n@dataclass(kw_only=True, frozen=True)\nclass DeebotButtonEntityDescription(\n    ButtonEntityDescription,  # type: ignore\n    DeebotEntityDescription,\n):\n    \"\"\"Class describing debbot button entity.\"\"\"\n\n\nENTITY_DESCRIPTIONS: tuple[DeebotButtonEntityDescription, ...] = (\n    DeebotButtonEntityDescription(\n        capability_fn=lambda caps: caps.map.relocation if caps.map else None,\n        key=\"relocate\",\n        translation_key=\"relocate\",\n        icon=\"mdi:map-marker-question\",\n        entity_registry_enabled_default=True,  # Can be enabled as they don't poll data\n        entity_category=EntityCategory.DIAGNOSTIC,\n    ),\n)\n\n\nasync def async_setup_entry(\n    hass: HomeAssistant,\n    config_entry: ConfigEntry,\n    async_add_entities: AddEntitiesCallback,\n) -> None:\n    \"\"\"Add entities for passed config_entry in HA.\"\"\"\n    controller: DeebotController = hass.data[DOMAIN][config_entry.entry_id]\n    controller.register_platform_add_entities(\n        DeebotButtonEntity, ENTITY_DESCRIPTIONS, async_add_entities\n    )\n\n    def generate_reset_life_span(\n        device: Device,\n    ) -> Sequence[DeebotResetLifeSpanButtonEntity]:\n        return [\n            DeebotResetLifeSpanButtonEntity(device, component)\n            for component in device.capabilities.life_span.types\n        ]\n\n    controller.register_platform_add_entities_generator(\n        async_add_entities, generate_reset_life_span\n    )\n\n\nclass DeebotResetLifeSpanButtonEntity(\n    DeebotEntity[None, ButtonEntityDescription],\n    ButtonEntity,  # type: ignore\n):\n    \"\"\"Deebot reset life span button entity.\"\"\"\n\n    def __init__(self, device: Device, component: LifeSpan):\n        key = f\"life_span_{component.name.lower()}_reset\"\n        entity_description = ButtonEntityDescription(\n            key=key,\n            translation_key=key,\n            icon=\"mdi:air-filter\" if component == LifeSpan.FILTER else \"mdi:broom\",\n            entity_registry_enabled_default=True,  # Can be enabled as they don't poll data\n            entity_category=EntityCategory.CONFIG,\n        )\n        super().__init__(device, None, entity_description)\n        self._command = device.capabilities.life_span.reset(component)\n\n    async def async_press(self) -> None:\n        \"\"\"Press the button.\"\"\"\n        await self._device.execute_command(self._command)\n\n\nclass DeebotButtonEntity(\n    DeebotEntity[CapabilityExecute, DeebotButtonEntityDescription],\n    ButtonEntity,  # type: ignore\n):\n    \"\"\"Deebot button entity.\"\"\"\n\n    async def async_press(self) -> None:\n        \"\"\"Press the button.\"\"\"\n        await self._device.execute_command(self._capability.execute())\n"
  },
  {
    "path": "custom_components/deebot/config_flow.py",
    "content": "\"\"\"Config flow for Deebot integration.\"\"\"\nimport logging\nimport random\nimport string\nfrom types import MappingProxyType\nfrom typing import Any\n\nimport voluptuous as vol\nfrom aiohttp import ClientError\nfrom deebot_client.api_client import ApiClient\nfrom deebot_client.authentication import Authenticator, create_rest_config\nfrom deebot_client.exceptions import InvalidAuthenticationError\nfrom deebot_client.models import DeviceInfo\nfrom deebot_client.util import md5\nfrom homeassistant.config_entries import ConfigEntry, ConfigFlow, OptionsFlow\nfrom homeassistant.const import (\n    CONF_DEVICES,\n    CONF_MODE,\n    CONF_PASSWORD,\n    CONF_USERNAME,\n    CONF_VERIFY_SSL,\n)\nfrom homeassistant.core import HomeAssistant, callback\nfrom homeassistant.data_entry_flow import FlowResult\nfrom homeassistant.helpers import aiohttp_client, selector\n\nfrom . import get_bumper_device_id\nfrom .const import (\n    BUMPER_CONFIGURATION,\n    CONF_CLIENT_DEVICE_ID,\n    CONF_CONTINENT,\n    CONF_COUNTRY,\n    CONF_MODE_BUMPER,\n    CONF_MODE_CLOUD,\n    DOMAIN,\n)\n\n_LOGGER = logging.getLogger(__name__)\n\n# Generate a random device ID on each bootup\nDEEBOT_API_DEVICEID = \"\".join(\n    random.choice(string.ascii_uppercase + string.digits) for _ in range(8)\n)\n\n\nclass DeebotConfigFlow(ConfigFlow, domain=DOMAIN):  # type: ignore\n    \"\"\"Handle a config flow for Deebot.\"\"\"\n\n    VERSION = 4\n\n    def __init__(self) -> None:\n        self._data: dict[str, Any] = {}\n        self._devices: list[DeviceInfo] = []\n        self._mode: str | None = None\n        self._entry: ConfigEntry | None = None\n\n    @staticmethod\n    @callback  # type: ignore[misc]\n    def async_get_options_flow(\n        config_entry: ConfigEntry,\n    ) -> \"DeebotOptionsFlowHandler\":\n        \"\"\"Get the options flow for this handler.\"\"\"\n        return DeebotOptionsFlowHandler(config_entry)\n\n    async def async_step_user(\n        self, user_input: dict[str, Any] | None = None\n    ) -> FlowResult:\n        \"\"\"Handle the initial step.\"\"\"\n        errors = {}\n        data = {}\n\n        if user_input is not None:\n            data.update(user_input)\n            if len(data[CONF_COUNTRY]) != 2:\n                errors[CONF_COUNTRY] = \"invalid_country\"\n\n            if len(data[CONF_CONTINENT]) != 2:\n                errors[CONF_CONTINENT] = \"invalid_continent\"\n\n            if not errors:\n                try:\n                    self._devices = await _retrieve_devices(self.hass, data)\n                except ClientError:\n                    _LOGGER.debug(\"Cannot connect\", exc_info=True)\n                    errors[\"base\"] = \"cannot_connect\"\n                except InvalidAuthenticationError:\n                    errors[\"base\"] = \"invalid_auth\"\n                except Exception:  # pylint: disable=broad-except\n                    _LOGGER.error(\"Unexpected exception\", exc_info=True)\n                    errors[\"base\"] = \"unknown\"\n\n            if not errors:\n                if self._entry:\n                    # reauthentication\n                    self.hass.config_entries.async_update_entry(self._entry, data=data)\n                    self.hass.async_create_task(\n                        self.hass.config_entries.async_reload(self._entry.entry_id)\n                    )\n                    return self.async_abort(reason=\"reauth_successful\")\n\n                self._async_abort_entries_match(\n                    {CONF_USERNAME: user_input[CONF_USERNAME]}\n                )\n\n                if len(self._devices) == 0:\n                    return self.async_abort(reason=\"no_supported_devices_found\")\n\n                self._data.update(data)\n                return await self.async_step_options()\n\n        if self._entry:\n            data.update(self._entry.data)\n        elif self.show_advanced_options and self._mode is None:\n            return await self.async_step_user_advanced()\n\n        return self.async_show_form(\n            step_id=\"user\",\n            data_schema=vol.Schema(\n                {\n                    vol.Required(\n                        CONF_USERNAME,\n                        default=data.get(CONF_USERNAME, vol.UNDEFINED),\n                    ): selector.TextSelector(\n                        selector.TextSelectorConfig(type=selector.TextSelectorType.TEXT)\n                    ),\n                    vol.Required(CONF_PASSWORD): selector.TextSelector(\n                        selector.TextSelectorConfig(\n                            type=selector.TextSelectorType.PASSWORD\n                        )\n                    ),\n                    vol.Required(\n                        CONF_COUNTRY,\n                        default=data.get(CONF_COUNTRY, vol.UNDEFINED),\n                    ): selector.TextSelector(\n                        selector.TextSelectorConfig(type=selector.TextSelectorType.TEXT)\n                    ),\n                    vol.Required(\n                        CONF_CONTINENT,\n                        default=data.get(CONF_CONTINENT, vol.UNDEFINED),\n                    ): selector.TextSelector(\n                        selector.TextSelectorConfig(type=selector.TextSelectorType.TEXT)\n                    ),\n                }\n            ),\n            errors=errors,\n        )\n\n    async def async_step_user_advanced(\n        self, user_input: dict[str, Any] | None = None\n    ) -> FlowResult:\n        \"\"\"Handle an advanced mode flow initialized by the user.\"\"\"\n        if user_input is not None:\n            self._mode = user_input.get(CONF_MODE, CONF_MODE_CLOUD)\n            if self._mode == CONF_MODE_BUMPER:\n                config = {\n                    **BUMPER_CONFIGURATION,\n                    CONF_CLIENT_DEVICE_ID: get_bumper_device_id(self.hass),\n                }\n                return await self.async_step_user(user_input=config)\n\n            return await self.async_step_user()\n\n        return self.async_show_form(\n            step_id=\"user_advanced\",\n            data_schema=vol.Schema(\n                {\n                    vol.Required(\n                        CONF_MODE, default=CONF_MODE_CLOUD\n                    ): selector.SelectSelector(\n                        selector.SelectSelectorConfig(\n                            options=[\n                                CONF_MODE_CLOUD,\n                                CONF_MODE_BUMPER,\n                            ]\n                        )\n                    )\n                }\n            ),\n        )\n\n    async def async_step_options(\n        self, user_input: dict[str, Any] | None = None\n    ) -> FlowResult:\n        \"\"\"Handle the options step.\"\"\"\n\n        errors = {}\n        if user_input is not None:\n            try:\n                if len(user_input[CONF_DEVICES]) < 1:\n                    errors[CONF_DEVICES] = \"select_robots\"\n                else:\n                    return self.async_create_entry(\n                        title=self._data[CONF_USERNAME],\n                        data=self._data,\n                        options=user_input,\n                    )\n            except Exception:  # pylint: disable=broad-except\n                _LOGGER.error(\"Unexpected exception\", exc_info=True)\n                errors[\"base\"] = \"unknown\"\n\n        # If there is no user input or there were errors, show the form again, including any errors that were found with the input.\n        return self.async_show_form(\n            step_id=\"options\",\n            data_schema=_get_options_schema(self._devices, {}),\n            errors=errors,\n        )\n\n    async def async_step_reauth(self, data: dict[str, Any]) -> FlowResult:\n        \"\"\"Handle initiation of re-authentication.\"\"\"\n        self._entry = self.hass.config_entries.async_get_entry(self.context[\"entry_id\"])\n        return await self.async_step_user(data)\n\n\ndef _get_options_schema(\n    devices: list[DeviceInfo], defaults: dict[str, Any] | MappingProxyType[str, Any]\n) -> vol.Schema:\n    \"\"\"Return options schema.\"\"\"\n    select_options = []\n\n    for entry in devices:\n        api_info = entry.api_device_info\n        label = api_info.get(\"nick\", api_info[\"name\"])\n        if not label:\n            label = api_info[\"name\"]\n        select_options.append(\n            selector.SelectOptionDict(value=api_info[\"name\"], label=label)\n        )\n\n    return vol.Schema(\n        {\n            vol.Required(\n                CONF_DEVICES, default=defaults.get(CONF_DEVICES, vol.UNDEFINED)\n            ): selector.SelectSelector(\n                selector.SelectSelectorConfig(\n                    options=select_options,\n                    multiple=True,\n                )\n            )\n        }\n    )\n\n\nasync def _retrieve_devices(\n    hass: HomeAssistant, domain_config: dict[str, Any]\n) -> list[DeviceInfo]:\n    verify_ssl = domain_config.get(CONF_VERIFY_SSL, True)\n    deebot_config = create_rest_config(\n        aiohttp_client.async_get_clientsession(hass, verify_ssl=verify_ssl),\n        device_id=DEEBOT_API_DEVICEID,\n        alpha_2_country=domain_config[CONF_COUNTRY].upper(),\n    )\n\n    authenticator = Authenticator(\n        deebot_config,\n        domain_config[CONF_USERNAME],\n        md5(domain_config[CONF_PASSWORD]),\n    )\n    api_client = ApiClient(authenticator)\n\n    devices = await api_client.get_devices()\n    return [device for device in devices if isinstance(device, DeviceInfo)]\n\n\nclass DeebotOptionsFlowHandler(OptionsFlow):  # type: ignore[misc]\n    \"\"\"Handle deebot options.\"\"\"\n\n    def __init__(self, config_entry: ConfigEntry) -> None:\n        \"\"\"Initialize options flow.\"\"\"\n        self._config_entry = config_entry\n        self._devices: list[DeviceInfo] | None = None\n\n    async def async_step_init(\n        self, user_input: dict[str, Any] | None = None\n    ) -> FlowResult:\n        \"\"\"Manage options.\"\"\"\n        errors = {}\n        if user_input is not None:\n            try:\n                if len(user_input[CONF_DEVICES]) < 1:\n                    errors[CONF_DEVICES] = \"select_robots\"\n                else:\n                    return self.async_create_entry(\n                        title=self._config_entry.title,\n                        data=user_input,\n                    )\n            except Exception:  # pylint: disable=broad-except\n                _LOGGER.error(\"Unexpected exception\", exc_info=True)\n                errors[\"base\"] = \"unknown\"\n\n        if user_input is None:\n            user_input = self._config_entry.options\n\n        if not self._devices:\n            try:\n                self._devices = await _retrieve_devices(\n                    self.hass, self._config_entry.data\n                )\n            except ClientError:\n                _LOGGER.debug(\"Cannot connect\", exc_info=True)\n                return self.async_abort(reason=\"cannot_connect\")\n            except InvalidAuthenticationError:\n                return self.async_abort(reason=\"invalid_auth\")\n            except Exception:  # pylint: disable=broad-except\n                _LOGGER.error(\"Unexpected exception on getting devices\", exc_info=True)\n                return self.async_abort(reason=\"unknown_get_devices\")\n\n            if len(self._devices) == 0:\n                return self.async_abort(reason=\"no_supported_devices_found\")\n\n        return self.async_show_form(\n            step_id=\"init\",\n            data_schema=_get_options_schema(self._devices, user_input),\n            errors=errors,\n        )\n"
  },
  {
    "path": "custom_components/deebot/const.py",
    "content": "\"\"\"Const module.\"\"\"\nfrom collections.abc import Mapping\n\nfrom deebot_client.events import (\n    BatteryEvent,\n    CleanLogEvent,\n    ErrorEvent,\n    Event,\n    FanSpeedEvent,\n    LifeSpanEvent,\n    RoomsEvent,\n    StateEvent,\n    StatsEvent,\n    WaterInfoEvent,\n)\nfrom homeassistant.const import CONF_PASSWORD, CONF_USERNAME, CONF_VERIFY_SSL\n\n################################\n# Do not change! Will be set by release workflow\nINTEGRATION_VERSION = \"dev\"  # git tag will be used\nMIN_REQUIRED_HA_VERSION = \"2024.1.0b0\"  # set min required version in hacs.json\n################################\n\n# Values below can be changed\nDOMAIN = \"deebot\"\nISSUE_URL = \"https://github.com/DeebotUniverse/Deebot-4-Home-Assistant/issues\"\n\nSTARTUP_MESSAGE = f\"\"\"\n-------------------------------------------------------------------\n{DOMAIN}\nVersion: {INTEGRATION_VERSION}\nThis is a custom component\nIf you have any issues with this you need to open an issue here:\n{ISSUE_URL}\n-------------------------------------------------------------------\n\"\"\"\n\nCONF_COUNTRY = \"country\"\nCONF_CONTINENT = \"continent\"\nCONF_BUMPER = \"Bumper\"\nCONF_MODE_BUMPER = CONF_BUMPER\nCONF_MODE_CLOUD = \"Cloud (recommended)\"\nCONF_CLIENT_DEVICE_ID = \"client_device_id\"\n\n# Bumper has no auth and serves the urls for all countries/continents\nBUMPER_CONFIGURATION = {\n    CONF_CONTINENT: \"eu\",\n    CONF_COUNTRY: \"it\",\n    CONF_PASSWORD: CONF_BUMPER,\n    CONF_USERNAME: CONF_BUMPER,\n    CONF_VERIFY_SSL: False,  # required as bumper is using self signed certificates\n}\n\nDEEBOT_DEVICES = f\"{DOMAIN}_devices\"\n\n\nREFRESH_STR_TO_EVENT_DTO: Mapping[str, type[Event]] = {\n    \"battery\": BatteryEvent,\n    \"clean_logs\": CleanLogEvent,\n    \"error\": ErrorEvent,\n    \"fan_speed\": FanSpeedEvent,\n    \"life_spans\": LifeSpanEvent,\n    \"rooms\": RoomsEvent,\n    \"stats\": StatsEvent,\n    \"status\": StateEvent,\n    \"water\": WaterInfoEvent,\n}\nREFRESH_MAP = \"map\"\n\nEVENT_CLEANING_JOB = \"deebot_cleaning_job\"\nEVENT_CUSTOM_COMMAND = \"deebot_custom_command\"\n"
  },
  {
    "path": "custom_components/deebot/controller.py",
    "content": "\"\"\"Controller module.\"\"\"\nimport logging\nimport random\nimport string\nfrom collections.abc import Callable, Mapping, Sequence\nfrom typing import Any\n\nfrom deebot_client.api_client import ApiClient\nfrom deebot_client.authentication import Authenticator, create_rest_config\nfrom deebot_client.const import UNDEFINED\nfrom deebot_client.device import Device\nfrom deebot_client.exceptions import InvalidAuthenticationError\nfrom deebot_client.models import ApiDeviceInfo, DeviceInfo\nfrom deebot_client.mqtt_client import MqttClient, create_mqtt_config\nfrom deebot_client.util import md5\nfrom homeassistant.const import (\n    CONF_DEVICES,\n    CONF_PASSWORD,\n    CONF_USERNAME,\n    CONF_VERIFY_SSL,\n)\nfrom homeassistant.core import HomeAssistant\nfrom homeassistant.exceptions import ConfigEntryAuthFailed, ConfigEntryNotReady\nfrom homeassistant.helpers import aiohttp_client\nfrom homeassistant.helpers.device_registry import DeviceEntry\nfrom homeassistant.helpers.entity import EntityDescription\nfrom homeassistant.helpers.entity_platform import AddEntitiesCallback\nfrom homeassistant.util.ssl import get_default_no_verify_context\n\nfrom custom_components.deebot.entity import DeebotEntity, DeebotEntityDescription\n\nfrom .const import CONF_CLIENT_DEVICE_ID, CONF_COUNTRY\n\n_LOGGER = logging.getLogger(__name__)\n\n_EntityGeneratorType = Callable[\n    [Device], Sequence[DeebotEntity[Any, EntityDescription]]\n]\n\n\nclass DeebotController:\n    \"\"\"Deebot Controller.\"\"\"\n\n    def __init__(self, hass: HomeAssistant, config: Mapping[str, Any]):\n        self._hass_config: Mapping[str, Any] = config\n        self._hass: HomeAssistant = hass\n        self._devices: list[Device] = []\n        verify_ssl = config.get(CONF_VERIFY_SSL, True)\n        device_id = config.get(CONF_CLIENT_DEVICE_ID)\n\n        if not device_id:\n            # Generate a random device ID on each bootup\n            device_id = \"\".join(\n                random.choice(string.ascii_uppercase + string.digits) for _ in range(12)\n            )\n\n        country = config.get(CONF_COUNTRY, \"it\").upper()\n        deebot_config = create_rest_config(\n            aiohttp_client.async_get_clientsession(self._hass, verify_ssl=verify_ssl),\n            device_id=device_id,\n            alpha_2_country=country,\n        )\n\n        self._authenticator = Authenticator(\n            deebot_config,\n            config.get(CONF_USERNAME, \"\"),\n            md5(config.get(CONF_PASSWORD, \"\")),\n        )\n        self._api_client = ApiClient(self._authenticator)\n\n        mqtt_config = create_mqtt_config(\n            device_id=device_id,\n            country=country,\n            ssl_context=UNDEFINED if verify_ssl else get_default_no_verify_context(),\n        )\n        self._mqtt: MqttClient = MqttClient(mqtt_config, self._authenticator)\n\n    async def initialize(self) -> None:\n        \"\"\"Init controller.\"\"\"\n        try:\n            await self.teardown()\n\n            devices = await self._api_client.get_devices()\n\n            await self._mqtt.connect()\n\n            for device in devices:\n                if not isinstance(device, DeviceInfo):\n                    # Legacy devices are not supported\n                    continue\n\n                if device.api_device_info[\"name\"] in self._hass_config.get(\n                    CONF_DEVICES, []\n                ):\n                    bot = Device(device, self._authenticator)\n                    _LOGGER.debug(\n                        \"New vacbot found: %s\", device.api_device_info[\"name\"]\n                    )\n                    await bot.initialize(self._mqtt)\n                    self._devices.append(bot)\n\n            _LOGGER.debug(\"Controller initialize complete\")\n        except InvalidAuthenticationError as ex:\n            raise ConfigEntryAuthFailed from ex\n        except Exception as ex:\n            msg = \"Error during setup\"\n            _LOGGER.error(msg, exc_info=True)\n            raise ConfigEntryNotReady(msg) from ex\n\n    def register_platform_add_entities(\n        self,\n        entity_class: type[DeebotEntity],\n        descriptions: tuple[DeebotEntityDescription, ...],\n        async_add_entities: AddEntitiesCallback,\n    ) -> None:\n        \"\"\"Create entities from descriptions and add them.\"\"\"\n        new_entites: list[DeebotEntity] = []\n\n        for device in self._devices:\n            for description in descriptions:\n                if capability := description.capability_fn(device.capabilities):\n                    new_entites.append(entity_class(device, capability, description))\n\n        if new_entites:\n            async_add_entities(new_entites)\n\n    def register_platform_add_entities_generator(\n        self,\n        async_add_entities: AddEntitiesCallback,\n        functions: _EntityGeneratorType | tuple[_EntityGeneratorType, ...],\n    ) -> None:\n        \"\"\"Add entities generated through the provided function.\"\"\"\n        new_entites: list[DeebotEntity[Any, EntityDescription]] = []\n\n        for device in self._devices:\n            if callable(functions):\n                functions = (functions,)\n            for func in functions:\n                new_entites.extend(func(device))\n\n        if new_entites:\n            async_add_entities(new_entites)\n\n    def get_device_info(self, device: DeviceEntry) -> ApiDeviceInfo | dict[str, str]:\n        \"\"\"Get the device info for the given entry.\"\"\"\n        for bot in self._devices:\n            for identifier in device.identifiers:\n                if bot.device_info.did == identifier[1]:\n                    return bot.device_info.api_device_info\n\n        _LOGGER.error(\"Could not find the device with entry: %s\", device.json_repr)\n        return {\"error\": \"Could not find the device\"}\n\n    async def teardown(self) -> None:\n        \"\"\"Disconnect controller.\"\"\"\n        for bot in self._devices:\n            await bot.teardown()\n        await self._mqtt.disconnect()\n        await self._authenticator.teardown()\n"
  },
  {
    "path": "custom_components/deebot/diagnostics.py",
    "content": "\"\"\"Diagnostics support for deebot.\"\"\"\nfrom __future__ import annotations\n\nfrom typing import Any\n\nfrom homeassistant.components.diagnostics import async_redact_data\nfrom homeassistant.config_entries import ConfigEntry\nfrom homeassistant.const import CONF_DEVICES, CONF_PASSWORD, CONF_USERNAME\nfrom homeassistant.core import HomeAssistant\nfrom homeassistant.helpers.device_registry import DeviceEntry\n\nfrom . import DOMAIN\nfrom .controller import DeebotController\n\nREDACT_CONFIG = {CONF_USERNAME, CONF_PASSWORD, CONF_DEVICES, \"title\"}\nREDACT_DEVICE = {\"did\", \"name\", \"homeId\"}\n\n\nasync def async_get_device_diagnostics(\n    hass: HomeAssistant, config_entry: ConfigEntry, device: DeviceEntry\n) -> dict[str, Any]:\n    \"\"\"Return diagnostics for a device.\"\"\"\n    controller: DeebotController = hass.data[DOMAIN][config_entry.entry_id]\n    diag: dict[str, Any] = {\n        \"config\": async_redact_data(config_entry.as_dict(), REDACT_CONFIG)\n    }\n\n    diag[\"device\"] = async_redact_data(\n        controller.get_device_info(device), REDACT_DEVICE\n    )\n\n    return diag\n"
  },
  {
    "path": "custom_components/deebot/entity.py",
    "content": "\"\"\"Deebot entity module.\"\"\"\nfrom collections.abc import Callable, Coroutine\nfrom dataclasses import dataclass\nfrom typing import Any, Generic, TypeVar\n\nfrom deebot_client.capabilities import Capabilities\nfrom deebot_client.device import Device\nfrom deebot_client.events import AvailabilityEvent\nfrom deebot_client.events.base import Event\nfrom homeassistant.helpers import device_registry as dr\nfrom homeassistant.helpers.entity import DeviceInfo, Entity, EntityDescription\n\nfrom .const import DOMAIN\n\n_EntityDescriptionT = TypeVar(\"_EntityDescriptionT\", bound=EntityDescription)\nCapabilityT = TypeVar(\"CapabilityT\")\nEventT = TypeVar(\"EventT\", bound=Event)\n\n\n@dataclass(kw_only=True, frozen=True)\nclass DeebotEntityDescription(\n    EntityDescription,  # type: ignore\n    Generic[CapabilityT],\n):\n    \"\"\"Deebot Entity Description.\"\"\"\n\n    capability_fn: Callable[[Capabilities], CapabilityT | None]\n\n\nclass DeebotEntity(Entity, Generic[CapabilityT, _EntityDescriptionT]):  # type: ignore\n    \"\"\"Deebot entity.\"\"\"\n\n    entity_description: _EntityDescriptionT\n\n    _attr_should_poll = False\n    _attr_has_entity_name = True\n    _always_available: bool = False\n    _subscribed_events: set[type[Event]] = set()\n\n    def __init__(\n        self,\n        device: Device,\n        capability: CapabilityT,\n        entity_description: _EntityDescriptionT | None = None,\n        **kwargs: Any,\n    ):\n        \"\"\"Initialize entity.\"\"\"\n        super().__init__(**kwargs)\n        if entity_description:\n            self.entity_description = entity_description\n        elif not hasattr(self, \"entity_description\"):\n            raise ValueError(\n                '\"entity_description\" must be either set as class variable or passed on init!'\n            )\n\n        self._device = device\n        self._capability = capability\n\n        self._attr_unique_id = self._device.device_info.did\n\n        if self.entity_description.key:\n            self._attr_unique_id += f\"_{self.entity_description.key}\"\n\n    @property\n    def device_info(self) -> DeviceInfo | None:\n        \"\"\"Return device specific attributes.\"\"\"\n        device_info = self._device.device_info\n        info = DeviceInfo(\n            identifiers={(DOMAIN, device_info.did)},\n            manufacturer=\"Ecovacs\",\n            sw_version=self._device.fw_version,\n            serial_number=device_info.name,\n        )\n\n        if nick := device_info.api_device_info.get(\"nick\"):\n            info[\"name\"] = nick\n\n        if model := device_info.api_device_info.get(\"deviceName\"):\n            info[\"model\"] = model\n\n        if mac := self._device.mac:\n            info[\"connections\"] = {(dr.CONNECTION_NETWORK_MAC, mac)}\n\n        return info\n\n    async def async_added_to_hass(self) -> None:\n        \"\"\"Set up the event listeners now that hass is ready.\"\"\"\n        await super().async_added_to_hass()\n\n        if not self._always_available:\n\n            async def on_available(event: AvailabilityEvent) -> None:\n                self._attr_available = event.available\n                self.async_write_ha_state()\n\n            self._subscribe(AvailabilityEvent, on_available)\n\n    def _subscribe(\n        self,\n        event_type: type[EventT],\n        callback: Callable[[EventT], Coroutine[Any, Any, None]],\n    ) -> None:\n        \"\"\"Subscribe to events.\"\"\"\n        self._subscribed_events.add(event_type)\n        self.async_on_remove(self._device.events.subscribe(event_type, callback))\n\n    async def async_update(self) -> None:\n        \"\"\"Update the entity.\n\n        Only used by the generic entity update service.\n        \"\"\"\n        for event_type in self._subscribed_events:\n            self._device.events.request_refresh(event_type)\n"
  },
  {
    "path": "custom_components/deebot/image.py",
    "content": "\"\"\"Support for Deebot image entities.\"\"\"\nfrom collections.abc import MutableMapping, Sequence\nfrom typing import Any\n\nfrom deebot_client.capabilities import CapabilityMap\nfrom deebot_client.device import Device\nfrom deebot_client.events.map import CachedMapInfoEvent, MapChangedEvent\nfrom homeassistant.components.image import ImageEntity\nfrom homeassistant.config_entries import ConfigEntry\nfrom homeassistant.core import HomeAssistant\nfrom homeassistant.helpers.entity import EntityDescription\nfrom homeassistant.helpers.entity_platform import AddEntitiesCallback\n\nfrom .const import DOMAIN\nfrom .controller import DeebotController\nfrom .entity import DeebotEntity\n\n\nasync def async_setup_entry(\n    hass: HomeAssistant,\n    config_entry: ConfigEntry,\n    async_add_entities: AddEntitiesCallback,\n) -> None:\n    \"\"\"Add entities for passed config_entry in HA.\"\"\"\n    controller: DeebotController = hass.data[DOMAIN][config_entry.entry_id]\n\n    def image_entity_generator(\n        device: Device,\n    ) -> Sequence[DeebotMap]:\n        new_entities = []\n        if caps := device.capabilities.map:\n            new_entities.append(DeebotMap(hass, device, caps))\n\n        return new_entities\n\n    controller.register_platform_add_entities_generator(\n        async_add_entities, image_entity_generator\n    )\n\n\nclass DeebotMap(\n    DeebotEntity[CapabilityMap, EntityDescription],\n    ImageEntity,  # type: ignore\n):\n    \"\"\"Deebot map.\"\"\"\n\n    _attr_content_type = \"image/svg+xml\"\n\n    def __init__(self, hass: HomeAssistant, device: Device, capability: CapabilityMap):\n        super().__init__(\n            device,\n            capability,\n            EntityDescription(\n                key=\"map\",\n                translation_key=\"map\",\n                entity_registry_enabled_default=False,\n            ),\n            hass=hass,\n        )\n        self._attr_extra_state_attributes: MutableMapping[str, Any] = {}\n\n    def image(self) -> bytes | None:\n        \"\"\"Return bytes of image or None.\"\"\"\n        if svg := self._device.map.get_svg_map():\n            return svg.encode()\n\n        return None\n\n    async def async_added_to_hass(self) -> None:\n        \"\"\"Set up the event listeners now that hass is ready.\"\"\"\n        await super().async_added_to_hass()\n\n        async def on_info(event: CachedMapInfoEvent) -> None:\n            self._attr_extra_state_attributes[\"map_name\"] = event.name\n\n        async def on_changed(event: MapChangedEvent) -> None:\n            self._attr_image_last_updated = event.when\n            self.async_write_ha_state()\n\n        self._subscribe(self._capability.chached_info.event, on_info)\n        self._subscribe(self._capability.changed.event, on_changed)\n\n    async def async_update(self) -> None:\n        \"\"\"Update the entity.\n\n        Only used by the generic entity update service.\n        \"\"\"\n        await super().async_update()\n        self._device.map.refresh()\n"
  },
  {
    "path": "custom_components/deebot/manifest.json",
    "content": "{\n  \"domain\": \"deebot\",\n  \"name\": \"Deebot 4 Home Assistant\",\n  \"codeowners\": [\n    \"@DeebotUniverse\",\n    \"@edenhaus\"\n  ],\n  \"config_flow\": true,\n  \"documentation\": \"https://deebot.readthedocs.io/integrations/home-assistant\",\n  \"iot_class\": \"cloud_polling\",\n  \"issue_tracker\": \"https://github.com/DeebotUniverse/Deebot-4-Home-Assistant/issues\",\n  \"loggers\": [\n    \"custom_components.deebot\",\n    \"deebot_client\"\n  ],\n  \"requirements\": [\n    \"deebot-client==5.1.0\",\n    \"numpy>=1.23.2\"\n  ],\n  \"version\": \"v0.0.0\"\n}\n"
  },
  {
    "path": "custom_components/deebot/number.py",
    "content": "\"\"\"Number module.\"\"\"\nfrom collections.abc import Callable\nfrom dataclasses import dataclass\nfrom typing import Generic\n\nfrom deebot_client.capabilities import CapabilitySet\nfrom homeassistant.components.number import NumberEntity, NumberEntityDescription\nfrom homeassistant.config_entries import ConfigEntry\nfrom homeassistant.core import HomeAssistant\nfrom homeassistant.helpers.entity import EntityCategory\nfrom homeassistant.helpers.entity_platform import AddEntitiesCallback\nfrom numpy import array_split\n\nfrom .const import DOMAIN\nfrom .controller import DeebotController\nfrom .entity import DeebotEntity, DeebotEntityDescription, EventT\n\n\n@dataclass(kw_only=True, frozen=True)\nclass DeebotNumberEntityDescription(\n    NumberEntityDescription,  # type: ignore\n    DeebotEntityDescription,\n    Generic[EventT],\n):\n    \"\"\"Deebot number entity description.\"\"\"\n\n    icon_fn: Callable[[\"DeebotNumberEntity\"], str | None] = lambda _: None\n    native_max_value_fn: Callable[[EventT], float | None] = lambda _: None\n    value_fn: Callable[[EventT], float | None]\n\n\ndef _volume_icon(instance: \"DeebotNumberEntity\") -> str | None:\n    \"\"\"Return the icon for the volume number.\"\"\"\n    value = instance.native_value\n    if value is not None:\n        min_value = instance.native_min_value\n\n        arrays = array_split(range(min_value + 1, instance.native_max_value + 1), 3)\n        if value == min_value:\n            return \"mdi:volume-off\"\n        if value in arrays[0]:\n            return \"mdi:volume-low\"\n        if value in arrays[1]:\n            return \"mdi:volume-medium\"\n        if value in arrays[2]:\n            return \"mdi:volume-high\"\n\n    return \"mdi:volume-medium\"\n\n\nENTITY_DESCRIPTIONS: tuple[DeebotNumberEntityDescription, ...] = (\n    DeebotNumberEntityDescription(\n        capability_fn=lambda caps: caps.settings.volume,\n        value_fn=lambda e: e.volume,\n        native_max_value_fn=lambda e: e.maximum if e.maximum else None,\n        key=\"volume\",\n        translation_key=\"volume\",\n        entity_registry_enabled_default=False,\n        entity_category=EntityCategory.CONFIG,\n        native_min_value=0,\n        native_max_value=10,\n        native_step=1.0,\n        icon_fn=_volume_icon,\n    ),\n    DeebotNumberEntityDescription(\n        capability_fn=lambda caps: caps.clean.count,\n        value_fn=lambda e: e.count,\n        key=\"clean_count\",\n        translation_key=\"clean_count\",\n        entity_registry_enabled_default=False,\n        entity_category=EntityCategory.CONFIG,\n        native_min_value=1,\n        native_max_value=4,\n        native_step=1.0,\n        icon=\"mdi:counter\",\n    ),\n)\n\n\nasync def async_setup_entry(\n    hass: HomeAssistant,\n    config_entry: ConfigEntry,\n    async_add_entities: AddEntitiesCallback,\n) -> None:\n    \"\"\"Add entities for passed config_entry in HA.\"\"\"\n    controller: DeebotController = hass.data[DOMAIN][config_entry.entry_id]\n    controller.register_platform_add_entities(\n        DeebotNumberEntity, ENTITY_DESCRIPTIONS, async_add_entities\n    )\n\n\nclass DeebotNumberEntity(\n    DeebotEntity[CapabilitySet[EventT, int], DeebotNumberEntityDescription],\n    NumberEntity,  # type: ignore\n):\n    \"\"\"Deebot number entity.\"\"\"\n\n    async def async_added_to_hass(self) -> None:\n        \"\"\"Set up the event listeners now that hass is ready.\"\"\"\n        await super().async_added_to_hass()\n\n        async def on_event(event: EventT) -> None:\n            self._attr_native_value = self.entity_description.value_fn(event)\n            if maximum := self.entity_description.native_max_value_fn(event):\n                self._attr_native_max_value = maximum\n            if icon := self.entity_description.icon_fn(self):\n                self._attr_icon = icon\n            self.async_write_ha_state()\n\n        self._subscribe(self._capability.event, on_event)\n\n    async def async_set_native_value(self, value: float) -> None:\n        \"\"\"Set new value.\"\"\"\n        await self._device.execute_command(self._capability.set(int(value)))\n"
  },
  {
    "path": "custom_components/deebot/select.py",
    "content": "\"\"\"Select module.\"\"\"\nfrom collections.abc import Callable\nfrom dataclasses import dataclass\nfrom typing import Any, Generic\n\nfrom deebot_client.capabilities import CapabilitySetTypes\nfrom deebot_client.device import Device\nfrom homeassistant.components.select import SelectEntity, SelectEntityDescription\nfrom homeassistant.config_entries import ConfigEntry\nfrom homeassistant.core import HomeAssistant\nfrom homeassistant.helpers.entity import EntityCategory\nfrom homeassistant.helpers.entity_platform import AddEntitiesCallback\n\nfrom .const import DOMAIN\nfrom .controller import DeebotController\nfrom .entity import DeebotEntity, DeebotEntityDescription, EventT\n\n\n@dataclass(kw_only=True, frozen=True)\nclass DeebotSelectEntityDescription(\n    SelectEntityDescription,  # type: ignore\n    DeebotEntityDescription,\n    Generic[EventT],\n):\n    \"\"\"Deebot select entity description.\"\"\"\n\n    current_option_fn: Callable[[EventT], str | None]\n    options_fn: Callable[[CapabilitySetTypes], list[str]]\n\n\nENTITY_DESCRIPTIONS: tuple[DeebotSelectEntityDescription, ...] = (\n    DeebotSelectEntityDescription(\n        capability_fn=lambda caps: caps.water,\n        current_option_fn=lambda e: e.amount.display_name,\n        options_fn=lambda water: [amount.display_name for amount in water.types],\n        key=\"water_amount\",\n        translation_key=\"water_amount\",\n        entity_registry_enabled_default=False,\n        icon=\"mdi:water\",\n        entity_category=EntityCategory.CONFIG,\n    ),\n    DeebotSelectEntityDescription(\n        capability_fn=lambda caps: caps.clean.work_mode,\n        current_option_fn=lambda e: e.mode.display_name,\n        options_fn=lambda cap: [mode.display_name for mode in cap.types],\n        key=\"work_mode\",\n        translation_key=\"work_mode\",\n        entity_registry_enabled_default=False,\n        icon=\"mdi:cog\",\n        entity_category=EntityCategory.CONFIG,\n    ),\n)\n\n\nasync def async_setup_entry(\n    hass: HomeAssistant,\n    config_entry: ConfigEntry,\n    async_add_entities: AddEntitiesCallback,\n) -> None:\n    \"\"\"Add entities for passed config_entry in HA.\"\"\"\n    controller: DeebotController = hass.data[DOMAIN][config_entry.entry_id]\n    controller.register_platform_add_entities(\n        DeebotSelectEntity, ENTITY_DESCRIPTIONS, async_add_entities\n    )\n\n\nclass DeebotSelectEntity(\n    DeebotEntity[CapabilitySetTypes[EventT, str], DeebotSelectEntityDescription],\n    SelectEntity,  # type: ignore\n):\n    \"\"\"Deebot select entity.\"\"\"\n\n    _attr_current_option: str | None = None\n\n    def __init__(\n        self,\n        device: Device,\n        capability: CapabilitySetTypes[EventT, str],\n        entity_description: DeebotSelectEntityDescription | None = None,\n        **kwargs: Any,\n    ):\n        super().__init__(device, capability, entity_description, **kwargs)\n        self._attr_options = self.entity_description.options_fn(capability)\n\n    async def async_added_to_hass(self) -> None:\n        \"\"\"Set up the event listeners now that hass is ready.\"\"\"\n        await super().async_added_to_hass()\n\n        async def on_event(event: EventT) -> None:\n            self._attr_current_option = self.entity_description.current_option_fn(event)\n            self.async_write_ha_state()\n\n        self._subscribe(self._capability.event, on_event)\n\n    async def async_select_option(self, option: str) -> None:\n        \"\"\"Change the selected option.\"\"\"\n        await self._device.execute_command(self._capability.set(option))\n"
  },
  {
    "path": "custom_components/deebot/sensor.py",
    "content": "\"\"\"Sensor module.\"\"\"\nfrom collections.abc import Callable, MutableMapping, Sequence\nfrom dataclasses import dataclass\nfrom math import floor\nfrom typing import Any, Generic, TypeVar\n\nfrom deebot_client.capabilities import CapabilityEvent, CapabilityLifeSpan\nfrom deebot_client.device import Device\nfrom deebot_client.events import (\n    BatteryEvent,\n    CleanLogEvent,\n    ErrorEvent,\n    Event,\n    LifeSpan,\n    LifeSpanEvent,\n    NetworkInfoEvent,\n    StatsEvent,\n    TotalStatsEvent,\n)\nfrom homeassistant.components.sensor import (\n    SensorDeviceClass,\n    SensorEntity,\n    SensorEntityDescription,\n    SensorStateClass,\n)\nfrom homeassistant.config_entries import ConfigEntry\nfrom homeassistant.const import (\n    AREA_SQUARE_METERS,\n    ATTR_BATTERY_LEVEL,\n    CONF_DESCRIPTION,\n    PERCENTAGE,\n    EntityCategory,\n    UnitOfTime,\n)\nfrom homeassistant.core import HomeAssistant\nfrom homeassistant.helpers.entity_platform import AddEntitiesCallback\nfrom homeassistant.helpers.typing import StateType\n\nfrom .const import DOMAIN\nfrom .controller import DeebotController\nfrom .entity import DeebotEntity, DeebotEntityDescription, EventT\n\n\n@dataclass(kw_only=True, frozen=True)\nclass DeebotSensorEntityDescription(\n    SensorEntityDescription,  # type: ignore\n    DeebotEntityDescription,\n    Generic[EventT],\n):\n    \"\"\"Deebot sensor entity description.\"\"\"\n\n    extra_state_attributes_fn: Callable[\n        [EventT], MutableMapping[str, Any]\n    ] | None = None\n    value_fn: Callable[[EventT], StateType]\n\n\ndef _clean_log_event_value(event: CleanLogEvent) -> str | None:\n    if event.logs:\n        log = event.logs[0]\n        return log.stop_reason.display_name\n    return None\n\n\ndef _clean_log_event_attributes(event: CleanLogEvent) -> MutableMapping[str, Any]:\n    if event.logs:\n        log = event.logs[0]\n        return {\n            \"timestamp\": log.timestamp,\n            \"image_url\": log.image_url,\n            \"type\": log.type,\n            \"area\": log.area,\n            \"duration\": log.duration / 60,\n        }\n\n    return {}\n\n\nENTITY_DESCRIPTIONS: tuple[DeebotSensorEntityDescription, ...] = (\n    # Stats\n    DeebotSensorEntityDescription[StatsEvent](\n        key=\"stats_area\",\n        capability_fn=lambda caps: caps.stats.clean,\n        value_fn=lambda e: e.area,\n        translation_key=\"stats_area\",\n        icon=\"mdi:floor-plan\",\n        native_unit_of_measurement=AREA_SQUARE_METERS,\n        entity_registry_enabled_default=False,\n    ),\n    DeebotSensorEntityDescription[StatsEvent](\n        key=\"stats_time\",\n        capability_fn=lambda caps: caps.stats.clean,\n        value_fn=lambda e: round(e.time / 60) if e.time else None,\n        translation_key=\"stats_time\",\n        icon=\"mdi:timer-outline\",\n        native_unit_of_measurement=UnitOfTime.MINUTES,\n        entity_registry_enabled_default=False,\n    ),\n    DeebotSensorEntityDescription[StatsEvent](\n        capability_fn=lambda caps: caps.stats.clean,\n        value_fn=lambda e: e.type,\n        key=\"stats_type\",\n        translation_key=\"stats_type\",\n        icon=\"mdi:cog\",\n        entity_registry_enabled_default=False,\n    ),\n    # TotalStats\n    DeebotSensorEntityDescription[TotalStatsEvent](\n        capability_fn=lambda caps: caps.stats.total,\n        value_fn=lambda e: e.area,\n        key=\"stats_total_area\",\n        translation_key=\"stats_total_area\",\n        icon=\"mdi:floor-plan\",\n        native_unit_of_measurement=AREA_SQUARE_METERS,\n        entity_registry_enabled_default=False,\n        state_class=SensorStateClass.TOTAL_INCREASING,\n    ),\n    DeebotSensorEntityDescription[TotalStatsEvent](\n        capability_fn=lambda caps: caps.stats.total,\n        value_fn=lambda e: round(e.time / 3600),\n        key=\"stats_total_time\",\n        translation_key=\"stats_total_time\",\n        icon=\"mdi:timer-outline\",\n        native_unit_of_measurement=UnitOfTime.HOURS,\n        entity_registry_enabled_default=False,\n        state_class=SensorStateClass.TOTAL_INCREASING,\n    ),\n    DeebotSensorEntityDescription[TotalStatsEvent](\n        capability_fn=lambda caps: caps.stats.total,\n        value_fn=lambda e: e.cleanings,\n        key=\"stats_total_cleanings\",\n        translation_key=\"stats_total_cleanings\",\n        icon=\"mdi:counter\",\n        entity_registry_enabled_default=False,\n        state_class=SensorStateClass.TOTAL_INCREASING,\n    ),\n    DeebotSensorEntityDescription[BatteryEvent](\n        capability_fn=lambda caps: caps.battery,\n        value_fn=lambda e: e.value,\n        key=ATTR_BATTERY_LEVEL,\n        translation_key=ATTR_BATTERY_LEVEL,\n        native_unit_of_measurement=PERCENTAGE,\n        device_class=SensorDeviceClass.BATTERY,\n        entity_category=EntityCategory.DIAGNOSTIC,\n    ),\n    DeebotSensorEntityDescription[NetworkInfoEvent](\n        capability_fn=lambda caps: caps.network,\n        value_fn=lambda e: e.ip,\n        key=\"wifi_ip\",\n        translation_key=\"wifi_ip\",\n        icon=\"mdi:ip-network-outline\",\n        entity_registry_enabled_default=False,\n        entity_category=EntityCategory.DIAGNOSTIC,\n    ),\n    DeebotSensorEntityDescription[NetworkInfoEvent](\n        capability_fn=lambda caps: caps.network,\n        value_fn=lambda e: e.rssi,\n        key=\"wifi_rssi\",\n        translation_key=\"wifi_rssi\",\n        icon=\"mdi:signal-variant\",\n        entity_registry_enabled_default=False,\n        entity_category=EntityCategory.DIAGNOSTIC,\n    ),\n    DeebotSensorEntityDescription[NetworkInfoEvent](\n        capability_fn=lambda caps: caps.network,\n        value_fn=lambda e: e.ssid,\n        key=\"wifi_ssid\",\n        translation_key=\"wifi_ssid\",\n        icon=\"mdi:wifi\",\n        entity_registry_enabled_default=False,\n        entity_category=EntityCategory.DIAGNOSTIC,\n    ),\n)\n\n\n@dataclass(kw_only=True, frozen=True)\nclass DeebotLifeSpanSensorEntityDescription(\n    SensorEntityDescription,  # type: ignore\n):\n    \"\"\"Class describing Deebot sensor entity.\"\"\"\n\n    component: LifeSpan\n\n\nLIFE_SPAN_DESCRIPTIONS: tuple[DeebotLifeSpanSensorEntityDescription, ...] = (\n    DeebotLifeSpanSensorEntityDescription(\n        component=LifeSpan.BRUSH,\n        key=\"life_span_brush\",\n        translation_key=\"life_span_brush\",\n        icon=\"mdi:broom\",\n        entity_registry_enabled_default=False,\n        native_unit_of_measurement=\"%\",\n        entity_category=EntityCategory.DIAGNOSTIC,\n    ),\n    DeebotLifeSpanSensorEntityDescription(\n        component=LifeSpan.FILTER,\n        key=\"life_span_filter\",\n        translation_key=\"life_span_filter\",\n        icon=\"mdi:air-filter\",\n        entity_registry_enabled_default=False,\n        native_unit_of_measurement=\"%\",\n        entity_category=EntityCategory.DIAGNOSTIC,\n    ),\n    DeebotLifeSpanSensorEntityDescription(\n        component=LifeSpan.SIDE_BRUSH,\n        key=\"life_span_side_brush\",\n        translation_key=\"life_span_side_brush\",\n        icon=\"mdi:broom\",\n        entity_registry_enabled_default=False,\n        native_unit_of_measurement=\"%\",\n        entity_category=EntityCategory.DIAGNOSTIC,\n    ),\n)\n\n\nasync def async_setup_entry(\n    hass: HomeAssistant,\n    config_entry: ConfigEntry,\n    async_add_entities: AddEntitiesCallback,\n) -> None:\n    \"\"\"Add entities for passed config_entry in HA.\"\"\"\n    controller: DeebotController = hass.data[DOMAIN][config_entry.entry_id]\n    controller.register_platform_add_entities(\n        DeebotSensor, ENTITY_DESCRIPTIONS, async_add_entities\n    )\n\n    def last_error_entity_generator(\n        device: Device,\n    ) -> Sequence[LastErrorSensor]:\n        if capability := device.capabilities.error:\n            return [(LastErrorSensor(device, capability))]\n        return []\n\n    def last_cleaning_entity_generator(\n        device: Device,\n    ) -> Sequence[LastCleaningSensor]:\n        if capability := device.capabilities.clean.log:\n            return [(LastCleaningSensor(device, capability))]\n        return []\n\n    def life_span_entity_generator(device: Device) -> Sequence[LifeSpanSensor]:\n        new_entities = []\n        capability = device.capabilities.life_span\n        for description in LIFE_SPAN_DESCRIPTIONS:\n            if description.component in capability.types:\n                new_entities.append(LifeSpanSensor(device, capability, description))\n        return new_entities\n\n    controller.register_platform_add_entities_generator(\n        async_add_entities,\n        (\n            life_span_entity_generator,\n            last_error_entity_generator,\n            last_cleaning_entity_generator,\n        ),\n    )\n\n\nclass DeebotSensor(\n    DeebotEntity[CapabilityEvent, DeebotSensorEntityDescription],\n    SensorEntity,  # type: ignore\n):\n    \"\"\"Deebot sensor.\"\"\"\n\n    async def async_added_to_hass(self) -> None:\n        \"\"\"Set up the event listeners now that hass is ready.\"\"\"\n        await super().async_added_to_hass()\n\n        async def on_event(event: Event) -> None:\n            value = self.entity_description.value_fn(event)\n            if value is None:\n                return\n\n            self._attr_native_value = value\n            if attr_fn := self.entity_description.extra_state_attributes_fn:\n                self._attr_extra_state_attributes = attr_fn(event)\n            self.async_write_ha_state()\n\n        self._subscribe(self._capability.event, on_event)\n\n\nT = TypeVar(\"T\", bound=Event)\n\n\nclass LifeSpanSensor(\n    DeebotEntity[CapabilityLifeSpan, DeebotLifeSpanSensorEntityDescription],\n    SensorEntity,  # type: ignore\n):\n    \"\"\"Life span sensor.\"\"\"\n\n    async def async_added_to_hass(self) -> None:\n        \"\"\"Set up the event listeners now that hass is ready.\"\"\"\n        await super().async_added_to_hass()\n\n        async def on_event(event: LifeSpanEvent) -> None:\n            if event.type == self.entity_description.component:\n                self._attr_native_value = event.percent\n                self._attr_extra_state_attributes = {\n                    \"remaining\": floor(event.remaining / 60)\n                }\n                self.async_write_ha_state()\n\n        self._subscribe(self._capability.event, on_event)\n\n\nclass LastErrorSensor(\n    DeebotEntity[CapabilityEvent[ErrorEvent], SensorEntityDescription],\n    SensorEntity,  # type: ignore\n):\n    \"\"\"Last error sensor.\"\"\"\n\n    _always_available: bool = True\n    _unrecorded_attributes = frozenset({CONF_DESCRIPTION})\n    entity_description: SensorEntityDescription = SensorEntityDescription(\n        key=\"last_error\",\n        translation_key=\"last_error\",\n        icon=\"mdi:alert-circle\",\n        entity_registry_enabled_default=False,\n        entity_category=EntityCategory.DIAGNOSTIC,\n    )\n\n    async def async_added_to_hass(self) -> None:\n        \"\"\"Set up the event listeners now that hass is ready.\"\"\"\n        await super().async_added_to_hass()\n\n        async def on_event(event: ErrorEvent) -> None:\n            self._attr_native_value = event.code\n            self._attr_extra_state_attributes = {CONF_DESCRIPTION: event.description}\n\n            self.async_write_ha_state()\n\n        self._subscribe(self._capability.event, on_event)\n\n\nclass LastCleaningSensor(\n    DeebotEntity[CapabilityEvent[CleanLogEvent], SensorEntityDescription],\n    SensorEntity,  # type: ignore\n):\n    \"\"\"Last cleaning sensor.\"\"\"\n\n    _always_available: bool = True\n    entity_description: SensorEntityDescription = SensorEntityDescription(\n        key=\"last_cleaning\",\n        translation_key=\"last_cleaning\",\n        icon=\"mdi:history\",\n        entity_registry_enabled_default=False,\n    )\n\n    async def async_added_to_hass(self) -> None:\n        \"\"\"Set up the event listeners now that hass is ready.\"\"\"\n        await super().async_added_to_hass()\n\n        async def on_event(event: CleanLogEvent) -> None:\n            if event.logs:\n                log = event.logs[0]\n                self._attr_native_value = log.stop_reason.display_name\n                self._attr_extra_state_attributes = {\n                    \"timestamp\": log.timestamp,\n                    \"image_url\": log.image_url,\n                    \"type\": log.type,\n                    \"area\": log.area,\n                    \"duration\": log.duration / 60,\n                }\n\n                self.async_write_ha_state()\n\n        self._subscribe(self._capability.event, on_event)\n"
  },
  {
    "path": "custom_components/deebot/services.yaml",
    "content": "# Must be kept in sync with vacuum.py\nrefresh:\n  target:\n    entity:\n      integration: deebot\n      domain: vacuum\n  fields:\n    category:\n      required: true\n      advanced: false\n      example: \"status\"\n      default: \"status\"\n      selector:\n        select:\n          translation_key: \"refresh_category\"\n          sort: true\n          options:\n            - \"battery\"\n            - \"clean_logs\"\n            - \"error\"\n            - \"fan_speed\"\n            - \"life_spans\"\n            - \"map\"\n            - \"rooms\"\n            - \"stats\"\n            - \"status\"\n            - \"water\"\n"
  },
  {
    "path": "custom_components/deebot/switch.py",
    "content": "\"\"\"Switch module.\"\"\"\nfrom dataclasses import dataclass\nfrom typing import Any\n\nfrom deebot_client.capabilities import CapabilitySetEnable\nfrom deebot_client.events import EnableEvent\nfrom homeassistant.components.switch import SwitchEntity, SwitchEntityDescription\nfrom homeassistant.config_entries import ConfigEntry\nfrom homeassistant.core import HomeAssistant\nfrom homeassistant.helpers.entity import EntityCategory\nfrom homeassistant.helpers.entity_platform import AddEntitiesCallback\n\nfrom .const import DOMAIN\nfrom .controller import DeebotController\nfrom .entity import DeebotEntity, DeebotEntityDescription\n\n\n@dataclass(kw_only=True, frozen=True)\nclass DeebotSwitchEntityDescription(\n    SwitchEntityDescription,  # type: ignore\n    DeebotEntityDescription,\n):\n    \"\"\"Deebot switch entity description.\"\"\"\n\n\nENTITY_DESCRIPTIONS: tuple[DeebotSwitchEntityDescription, ...] = (\n    DeebotSwitchEntityDescription(\n        capability_fn=lambda c: c.settings.advanced_mode,\n        key=\"advanced_mode\",\n        translation_key=\"advanced_mode\",\n        entity_registry_enabled_default=False,\n        entity_category=EntityCategory.CONFIG,\n        icon=\"mdi:tune\",\n    ),\n    DeebotSwitchEntityDescription(\n        capability_fn=lambda c: c.clean.continuous,\n        key=\"continuous_cleaning\",\n        translation_key=\"continuous_cleaning\",\n        entity_registry_enabled_default=False,\n        entity_category=EntityCategory.CONFIG,\n        icon=\"mdi:refresh-auto\",\n    ),\n    DeebotSwitchEntityDescription(\n        capability_fn=lambda c: c.settings.carpet_auto_fan_boost,\n        key=\"carpet_auto_fan_speed_boost\",\n        translation_key=\"carpet_auto_fan_speed_boost\",\n        entity_registry_enabled_default=False,\n        entity_category=EntityCategory.CONFIG,\n        icon=\"mdi:fan-auto\",\n    ),\n    DeebotSwitchEntityDescription(\n        capability_fn=lambda c: c.clean.preference,\n        key=\"clean_preference\",\n        translation_key=\"clean_preference\",\n        entity_registry_enabled_default=False,\n        entity_category=EntityCategory.CONFIG,\n        icon=\"mdi:broom\",\n    ),\n    DeebotSwitchEntityDescription(\n        capability_fn=lambda c: c.settings.true_detect,\n        key=\"true_detect\",\n        translation_key=\"true_detect\",\n        entity_registry_enabled_default=False,\n        entity_category=EntityCategory.CONFIG,\n        icon=\"mdi:laser-pointer\",\n    ),\n)\n\n\nasync def async_setup_entry(\n    hass: HomeAssistant,\n    config_entry: ConfigEntry,\n    async_add_entities: AddEntitiesCallback,\n) -> None:\n    \"\"\"Add entities for passed config_entry in HA.\"\"\"\n    controller: DeebotController = hass.data[DOMAIN][config_entry.entry_id]\n    controller.register_platform_add_entities(\n        DeebotSwitchEntity, ENTITY_DESCRIPTIONS, async_add_entities\n    )\n\n\nclass DeebotSwitchEntity(\n    DeebotEntity[CapabilitySetEnable, DeebotSwitchEntityDescription],\n    SwitchEntity,  # type: ignore\n):\n    \"\"\"Deebot switch entity.\"\"\"\n\n    _attr_is_on = False\n\n    async def async_added_to_hass(self) -> None:\n        \"\"\"Set up the event listeners now that hass is ready.\"\"\"\n        await super().async_added_to_hass()\n\n        async def on_event(event: EnableEvent) -> None:\n            self._attr_is_on = event.enable\n            self.async_write_ha_state()\n\n        self._subscribe(self._capability.event, on_event)\n\n    async def async_turn_on(self, **kwargs: Any) -> None:\n        \"\"\"Turn the entity on.\"\"\"\n        await self._device.execute_command(self._capability.set(True))\n\n    async def async_turn_off(self, **kwargs: Any) -> None:\n        \"\"\"Turn the entity off.\"\"\"\n        await self._device.execute_command(self._capability.set(False))\n"
  },
  {
    "path": "custom_components/deebot/translations/de.json",
    "content": "{\n  \"config\": {\n    \"abort\": {\n      \"already_configured\": \"Bereits konfiguriert\",\n      \"no_supported_devices_found\": \"Keine unterstützten Geräte gefunden\",\n      \"reauth_successful\": \"Die erneute Authentifizierung war erfolgreich\"\n    },\n    \"error\": {\n      \"cannot_connect\": \"Verbindung fehlgeschlagen. Weitere Infos in den Logs\",\n      \"invalid_auth\": \"Ungültige Authentifizierung\",\n      \"invalid_continent\": \"Ungültiger Kontinent! Code muss aus 2 Zeichen bestehen!\",\n      \"invalid_country\": \"Ungültiges Land! Ländercode muss aus 2 Zeichen bestehen!\",\n      \"select_robots\": \"Bitte wähle mindestens 1 Roboter aus\",\n      \"unknown\": \"Unerwarteter Fehler. Weitere Infos in den Logs\"\n    },\n    \"step\": {\n      \"options\": {\n        \"data\": {\n          \"devices\": \"Geräte\"\n        }\n      },\n      \"user\": {\n        \"data\": {\n          \"continent\": \"Kontinent\",\n          \"country\": \"Land\",\n          \"password\": \"Passwort\",\n          \"username\": \"E-mail oder ShortID\"\n        },\n        \"data_description\": {\n          \"continent\": \"2-stelliger Kontinentcode Bsp.: eu, ww. Wenn der Kontinentcode nicht funktioniert, verwende ww\",\n          \"country\": \"2-stelliger Ländercode. Bsp.: de, it, uk\"\n        }\n      },\n      \"user_advanced\": {\n        \"description\": \"Wähle \\\"Bumper\\\" nur, falls du eine funktionierende Bumper-Instanz hast. Ansonsten wähle bitte die empfohlene Variante \\\"Cloud\\\".\"\n      }\n    }\n  },\n  \"entity\": {\n    \"binary_sensor\": {\n      \"mop_attached\": {\n        \"name\": \"Wischmopp montiert\"\n      }\n    },\n    \"button\": {\n      \"life_span_brush_reset\": {\n        \"name\": \"Hauptbürste zurücksetzen\"\n      },\n      \"life_span_filter_reset\": {\n        \"name\": \"Filter zurücksetzen\"\n      },\n      \"life_span_side_brush_reset\": {\n        \"name\": \"Seitenbürsten zurücksetzen\"\n      },\n      \"relocate\": {\n        \"name\": \"Position aktualisieren\"\n      }\n    },\n    \"image\": {\n      \"map\": {\n        \"name\": \"Karte\"\n      }\n    },\n    \"number\": {\n      \"volume\": {\n        \"name\": \"Lautstärke\"\n      }\n    },\n    \"select\": {\n      \"water_amount\": {\n        \"name\": \"Wasserdurchflussrate\",\n        \"state\": {\n          \"high\": \"Hoch\",\n          \"low\": \"Niedrig\",\n          \"medium\": \"Mittel\",\n          \"ultrahigh\": \"Sehr hoch\"\n        }\n      }\n    },\n    \"sensor\": {\n      \"battery_level\": {\n        \"name\": \"Batterie\"\n      },\n      \"last_cleaning\": {\n        \"name\": \"Letzte Reinigung\"\n      },\n      \"last_error\": {\n        \"name\": \"Letzter Fehler\"\n      },\n      \"life_span_brush\": {\n        \"name\": \"Hauptbürste\"\n      },\n      \"life_span_filter\": {\n        \"name\": \"Filter\"\n      },\n      \"life_span_side_brush\": {\n        \"name\": \"Seitenbürsten\"\n      },\n      \"stats_area\": {\n        \"name\": \"Reinigungsfläche\"\n      },\n      \"stats_time\": {\n        \"name\": \"Reinigungsdauer\"\n      },\n      \"stats_total_area\": {\n        \"name\": \"Gesamtreinigungsfläche\"\n      },\n      \"stats_total_cleanings\": {\n        \"name\": \"Gesamtanzahl Reinigunen\"\n      },\n      \"stats_total_time\": {\n        \"name\": \"Gesamtreinigungsdauer\"\n      },\n      \"stats_type\": {\n        \"name\": \"Reinigungsmodus\"\n      }\n    },\n    \"switch\": {\n      \"advanced_mode\": {\n        \"name\": \"Erweiterter Modus\"\n      },\n      \"carpet_auto_fan_speed_boost\": {\n        \"name\": \"Auto-Saugkraftverstärkung\"\n      },\n      \"continuous_cleaning\": {\n        \"name\": \"Wiederaufnahme der Reinigung\"\n      }\n    },\n    \"vacuum\": {\n      \"bot\": {\n        \"state_attributes\": {\n          \"fan_speed\": {\n            \"state\": {\n              \"max\": \"Maximal\",\n              \"max_plus\": \"Maximal+\",\n              \"normal\": \"Standard\",\n              \"quiet\": \"Leise\"\n            }\n          },\n          \"last_error\": {\n            \"name\": \"Letzter Fehler\"\n          },\n          \"rooms\": {\n            \"name\": \"Räume\"\n          }\n        }\n      }\n    }\n  },\n  \"options\": {\n    \"abort\": {\n      \"cannot_connect\": \"Verbindung fehlgeschlagen. Weitere Infos in den Logs\",\n      \"invalid_auth\": \"Ungültige Authentifizierung. Bitte vorher neu konfigurieren\",\n      \"no_supported_devices_found\": \"Keine unterstützten Geräte gefunden\",\n      \"unknown_get_devices\": \"Unerwarteter Fehler beim Abholen aller Geräte. Weitere Infos in den Logs\"\n    },\n    \"error\": {\n      \"select_robots\": \"Bitte wähle mindestens 1 Roboter aus\",\n      \"unknown\": \"Unerwarteter Fehler. Weitere Infos in den Logs\"\n    },\n    \"step\": {\n      \"init\": {\n        \"data\": {\n          \"devices\": \"Geräte\"\n        },\n        \"data_description\": {\n          \"devices\": \"Bitte wähle alle Geräte aus, welche du im HA verwenden willst.\"\n        }\n      }\n    }\n  },\n  \"selector\": {\n    \"refresh_category\": {\n      \"options\": {\n        \"battery\": \"Batterie\",\n        \"clean_logs\": \"Reinungsprotokoll\",\n        \"error\": \"Fehler\",\n        \"fan_speed\": \"Lüftergeschwindigkeit\",\n        \"life_spans\": \"Komponentenabnutzung\",\n        \"map\": \"Karte\",\n        \"rooms\": \"Räume\",\n        \"stats\": \"Statistik\",\n        \"status\": \"Status\",\n        \"water\": \"Wasser\"\n      }\n    }\n  },\n  \"services\": {\n    \"refresh\": {\n      \"description\": \"Manuelle Aktualisierung der selektierten Kategorie.\",\n      \"fields\": {\n        \"category\": {\n          \"description\": \"Was soll aktualisiert werden?\",\n          \"name\": \"Kategorie\"\n        }\n      },\n      \"name\": \"Manuelle Aktualisierung\"\n    }\n  }\n}\n"
  },
  {
    "path": "custom_components/deebot/translations/en.json",
    "content": "{\n  \"config\": {\n    \"abort\": {\n      \"already_configured\": \"Already configured\",\n      \"no_supported_devices_found\": \"No supported devices found\",\n      \"reauth_successful\": \"Re-authentication was successful\"\n    },\n    \"error\": {\n      \"cannot_connect\": \"Can't connect to the ecovacs API. Please check the logs\",\n      \"invalid_auth\": \"Invalid username or password\",\n      \"invalid_continent\": \"Continent code should be two letter code\",\n      \"invalid_country\": \"Country code should be two letter code\",\n      \"select_robots\": \"Please select at least 1 robot\",\n      \"unknown\": \"Unknown error. Please check the logs\"\n    },\n    \"step\": {\n      \"options\": {\n        \"data\": {\n          \"devices\": \"Devices\"\n        },\n        \"data_description\": {\n          \"devices\": \"Please select all devices, which you want to use in HA.\"\n        }\n      },\n      \"user\": {\n        \"data\": {\n          \"continent\": \"Continent\",\n          \"country\": \"Country\",\n          \"password\": \"Password\",\n          \"username\": \"E-mail or ShortID\"\n        },\n        \"data_description\": {\n          \"continent\": \"The two letter continent code. Ex.: ww, eu. If your country code is not working try ww\",\n          \"country\": \"The two letter country code. Ex.: us, uk\"\n        }\n      },\n      \"user_advanced\": {\n        \"description\": \"Please select \\\"Bumper\\\" ONLY if you already have a working bumper instance. Otherwise, select \\\"Cloud\\\" please.\"\n      }\n    }\n  },\n  \"entity\": {\n    \"binary_sensor\": {\n      \"mop_attached\": {\n        \"name\": \"Mop attached\"\n      }\n    },\n    \"button\": {\n      \"life_span_brush_reset\": {\n        \"name\": \"Reset brush\"\n      },\n      \"life_span_filter_reset\": {\n        \"name\": \"Reset filter\"\n      },\n      \"life_span_side_brush_reset\": {\n        \"name\": \"Reset side brush\"\n      },\n      \"relocate\": {\n        \"name\": \"Relocate\"\n      }\n    },\n    \"image\": {\n      \"map\": {\n        \"name\": \"Map\"\n      }\n    },\n    \"number\": {\n      \"clean_count\": {\n        \"name\": \"Clean count\"\n      },\n      \"volume\": {\n        \"name\": \"Volume\"\n      }\n    },\n    \"select\": {\n      \"water_amount\": {\n        \"name\": \"Water amount\",\n        \"state\": {\n          \"high\": \"high\",\n          \"low\": \"low\",\n          \"medium\": \"medium\",\n          \"ultrahigh\": \"ultrahigh\"\n        }\n      },\n      \"work_mode\": {\n        \"name\": \"Work mode\",\n        \"state\": {\n          \"mop\": \"Mop\",\n          \"mop_after_vacuum\": \"Mop after vacuum\",\n          \"vacuum\": \"Vacuum\",\n          \"vacuum_and_mop\": \"Vacuum & mop\"\n        }\n      }\n    },\n    \"sensor\": {\n      \"battery_level\": {\n        \"name\": \"Battery level\"\n      },\n      \"last_cleaning\": {\n        \"name\": \"Last cleaning\"\n      },\n      \"last_error\": {\n        \"name\": \"Last error\"\n      },\n      \"life_span_brush\": {\n        \"name\": \"Brush\"\n      },\n      \"life_span_filter\": {\n        \"name\": \"Filter\"\n      },\n      \"life_span_side_brush\": {\n        \"name\": \"Side brush\"\n      },\n      \"stats_area\": {\n        \"name\": \"Stats area\"\n      },\n      \"stats_time\": {\n        \"name\": \"Stats time\"\n      },\n      \"stats_total_area\": {\n        \"name\": \"Stats total area\"\n      },\n      \"stats_total_cleanings\": {\n        \"name\": \"Stats total cleanings\"\n      },\n      \"stats_total_time\": {\n        \"name\": \"Stats total time\"\n      },\n      \"stats_type\": {\n        \"name\": \"Stats type\"\n      },\n      \"wifi_ip\": {\n        \"name\": \"Ip\"\n      },\n      \"wifi_rssi\": {\n        \"name\": \"Wifi rssi\"\n      },\n      \"wifi_ssid\": {\n        \"name\": \"Wifi ssid\"\n      }\n    },\n    \"switch\": {\n      \"advanced_mode\": {\n        \"name\": \"Advanced mode\"\n      },\n      \"carpet_auto_fan_speed_boost\": {\n        \"name\": \"Carpet auto fan speed boost\"\n      },\n      \"clean_preference\": {\n        \"name\": \"Clean preference\"\n      },\n      \"continuous_cleaning\": {\n        \"name\": \"Continuous cleaning\"\n      },\n      \"true_detect\": {\n        \"name\": \"True detect\"\n      }\n    },\n    \"vacuum\": {\n      \"bot\": {\n        \"state_attributes\": {\n          \"fan_speed\": {\n            \"state\": {\n              \"max\": \"Max\",\n              \"max_plus\": \"Max+\",\n              \"normal\": \"Normal\",\n              \"quiet\": \"Quiet\"\n            }\n          },\n          \"last_error\": {\n            \"name\": \"Last error\"\n          },\n          \"rooms\": {\n            \"name\": \"Rooms\"\n          }\n        }\n      }\n    }\n  },\n  \"issues\": {\n    \"deprecated_integration_issue\": {\n      \"description\": \"I migrated the custom component `Deebot 4 Home Assistant` to the core and merged it with the existing `Ecovacs` integration.\\n\\nThe custom component is no longer needed and will be archived in the future.\\n\\nEverything was migrated except:\\n- The events `cleaning_job` and `custom_command`.\\n- The last cleaning and stats type sensors\\n- Deprecated services\\n\\nMigration steps:\\n1: Remove all `Deebot 4 Home Assistant` config entries\\n2: Uninstall `Deebot 4 Home Assistant` via HACS\\n3: Restart Home Assistant\\n4: Setup the [Ecovacs integration]({docs_url}) by clicking [here]({config_url})\",\n      \"title\": \"Time to migrate!\"\n    },\n    \"deprecated_service_refresh\": {\n      \"fix_flow\": {\n        \"step\": {\n          \"confirm\": {\n            \"description\": \"The service `deebot.refresh` is deprecated and will be removed.\\nTo refresh an entity please use `homeassistant.update_entity` on the respective entity instead.\\n\\nPlease remove this service from your automations and scripts and select **submit** to close this issue.\",\n            \"title\": \"Deebot refresh service is being removed\"\n          }\n        }\n      },\n      \"title\": \"Deebot refresh service is being removed\"\n    }\n  },\n  \"options\": {\n    \"abort\": {\n      \"cannot_connect\": \"Can't connect to the ecovacs API. Please check the logs\",\n      \"invalid_auth\": \"Authentication failed. Please reauthenticate first\",\n      \"no_supported_devices_found\": \"No supported devices found\",\n      \"unknown_get_devices\": \"Unknown error on getting all devices. Please check the logs\"\n    },\n    \"error\": {\n      \"select_robots\": \"Please select at least 1 robot\",\n      \"unknown\": \"Unknown error. Please check the logs\"\n    },\n    \"step\": {\n      \"init\": {\n        \"data\": {\n          \"devices\": \"Devices\"\n        },\n        \"data_description\": {\n          \"devices\": \"Please select all devices, which you want to use in HA.\"\n        }\n      }\n    }\n  },\n  \"selector\": {\n    \"refresh_category\": {\n      \"options\": {\n        \"battery\": \"Battery\",\n        \"clean_logs\": \"Clean logs\",\n        \"error\": \"Error\",\n        \"fan_speed\": \"Fan speed\",\n        \"life_spans\": \"Life spans\",\n        \"map\": \"Map\",\n        \"rooms\": \"Rooms\",\n        \"stats\": \"Stats\",\n        \"status\": \"Status\",\n        \"water\": \"Water\"\n      }\n    }\n  },\n  \"services\": {\n    \"refresh\": {\n      \"description\": \"Manually request a refresh for the selected category.\",\n      \"fields\": {\n        \"category\": {\n          \"description\": \"Which category should be refreshed?\",\n          \"name\": \"Category\"\n        }\n      },\n      \"name\": \"Manually refresh\"\n    }\n  }\n}\n"
  },
  {
    "path": "custom_components/deebot/translations/fr.json",
    "content": "{\n  \"config\": {\n    \"abort\": {\n      \"already_configured\": \"Déjà configuré\",\n      \"no_supported_devices_found\": \"Aucun appareil pris en charge trouvé\",\n      \"reauth_successful\": \"Réauthentification réussie\"\n    },\n    \"error\": {\n      \"cannot_connect\": \"Connection impossible à l'API Ecovacs. Veuillez consulter les journaux.\",\n      \"invalid_auth\": \"Nom d’utilisateur ou mot de passe incorrect\",\n      \"invalid_continent\": \"Le code du continent doit être en deux lettres, ex: eu, as, na, ww\",\n      \"invalid_country\": \"Le code du pays doit être en deux lettres, ex: fr, be, us, ... \",\n      \"select_robots\": \"Sélectionnez au moins 1 robot\",\n      \"unknown\": \"Erreur inconnue. Veuillez consulter les journaux.\"\n    },\n    \"step\": {\n      \"options\": {\n        \"data\": {\n          \"devices\": \"Appareils\"\n        },\n        \"data_description\": {\n          \"devices\": \"Veuillez sélectionner tous les appareils que vous souhaitez utiliser dans HA.\"\n        }\n      },\n      \"user\": {\n        \"data\": {\n          \"continent\": \"Continent\",\n          \"country\": \"Pays\",\n          \"password\": \"Mot de passe\",\n          \"username\": \"E-mail ou Ecovacs ID\"\n        },\n        \"data_description\": {\n          \"continent\": \"Le code à deux lettres du continent. Ex : eu, as, na. Si le code de votre continent ne fonctionne pas, essayez ww\",\n          \"country\": \"Le code à deux lettres du pays. Ex : fr, be\"\n        }\n      },\n      \"user_advanced\": {\n        \"description\": \"Sélectionnez \\\"Bumper\\\" SEULEMENT si vous avez déjà une instance bumper fonctionnelle. Sinon, sélectionnez \\\"Cloud\\\" s'il vous plait.\"\n      }\n    }\n  },\n  \"entity\": {\n    \"binary_sensor\": {\n      \"mop_attached\": {\n        \"name\": \"Serpillière attachée\"\n      }\n    },\n    \"button\": {\n      \"life_span_brush_reset\": {\n        \"name\": \"Réinitialiser rouleau\"\n      },\n      \"life_span_filter_reset\": {\n        \"name\": \"Réinitialiser filtre\"\n      },\n      \"life_span_side_brush_reset\": {\n        \"name\": \"Réinitialiser brosses latérales\"\n      },\n      \"relocate\": {\n        \"name\": \"Relocalisation\"\n      }\n    },\n    \"image\": {\n      \"map\": {\n        \"name\": \"Carte\"\n      }\n    },\n    \"number\": {\n      \"clean_count\": {\n        \"name\": \"Compte de nettoyage\"\n      },\n      \"volume\": {\n        \"name\": \"Volume\"\n      }\n    },\n    \"select\": {\n      \"water_amount\": {\n        \"name\": \"Quantité d'eau\",\n        \"state\": {\n          \"high\": \"haute\",\n          \"low\": \"faible\",\n          \"medium\": \"moyenne\",\n          \"ultrahigh\": \"très élevée\"\n        }\n      }\n    },\n    \"sensor\": {\n      \"battery_level\": {\n        \"name\": \"Niveau de batterie\"\n      },\n      \"last_cleaning\": {\n        \"name\": \"Dernier nettoyage\"\n      },\n      \"last_error\": {\n        \"name\": \"Dernière erreur\"\n      },\n      \"life_span_brush\": {\n        \"name\": \"Rouleau\"\n      },\n      \"life_span_filter\": {\n        \"name\": \"Filtre\"\n      },\n      \"life_span_side_brush\": {\n        \"name\": \"Brosses latérales\"\n      },\n      \"stats_area\": {\n        \"name\": \"Surface\"\n      },\n      \"stats_time\": {\n        \"name\": \"Durée\"\n      },\n      \"stats_total_area\": {\n        \"name\": \"Surface totale\"\n      },\n      \"stats_total_cleanings\": {\n        \"name\": \"Nombre de nettoyages\"\n      },\n      \"stats_total_time\": {\n        \"name\": \"Durée totale\"\n      },\n      \"stats_type\": {\n        \"name\": \"Mode\"\n      }\n    },\n    \"switch\": {\n      \"advanced_mode\": {\n        \"name\": \"Mode avancé\"\n      },\n      \"carpet_auto_fan_speed_boost\": {\n        \"name\": \"Vitesse du ventilateur automatique sur moquette\"\n      },\n      \"clean_preference\": {\n        \"name\": \"Preference de nettoyage par pièce\"\n      },\n      \"continuous_cleaning\": {\n        \"name\": \"Nettoyage continu\"\n      },\n      \"true_detect\": {\n        \"name\": \"TrueDetect 3D\"\n      }\n    },\n    \"vacuum\": {\n      \"bot\": {\n        \"state_attributes\": {\n          \"fan_speed\": {\n            \"state\": {\n              \"max\": \"Fort\",\n              \"max_plus\": \"Max+\",\n              \"normal\": \"Standard\",\n              \"quiet\": \"Silencieux\"\n            }\n          },\n          \"last_error\": {\n            \"name\": \"Dernière erreur\"\n          },\n          \"rooms\": {\n            \"name\": \"Pièces\"\n          }\n        }\n      }\n    }\n  },\n  \"options\": {\n    \"abort\": {\n      \"cannot_connect\": \"Connection impossible à l'API Ecovacs. Veuillez consulter les journaux.\",\n      \"invalid_auth\": \"Echec de l'authentification. Veuillez d'abord vous réauthentifier.\",\n      \"no_supported_devices_found\": \"Aucun appareil pris en charge trouvé\",\n      \"unknown_get_devices\": \"Erreur inconnue lors de l'obtention des appareils. Veuillez consulter les journaux.\"\n    },\n    \"error\": {\n      \"select_robots\": \"Sélectionnez au moins 1 robot\",\n      \"unknown\": \"Erreur inconnue. Veuillez consulter les journaux.\"\n    },\n    \"step\": {\n      \"init\": {\n        \"data\": {\n          \"devices\": \"Appareils\"\n        },\n        \"data_description\": {\n          \"devices\": \"Veuillez sélectionner tous les appareils que vous souhaitez utiliser dans HA.\"\n        }\n      }\n    }\n  },\n  \"selector\": {\n    \"refresh_category\": {\n      \"options\": {\n        \"battery\": \"Batterie\",\n        \"clean_logs\": \"Journal des nettoyages\",\n        \"error\": \"Erreur\",\n        \"fan_speed\": \"Vitesse d'aspiration\",\n        \"life_spans\": \"Durée de vie\",\n        \"map\": \"Carte\",\n        \"rooms\": \"Pièces\",\n        \"stats\": \"Stats\",\n        \"status\": \"Statut\",\n        \"water\": \"Eau\"\n      }\n    }\n  },\n  \"services\": {\n    \"refresh\": {\n      \"description\": \"Demander manuellement une actualisation pour la catégorie sélectionnée.\",\n      \"fields\": {\n        \"category\": {\n          \"description\": \"Quelle catégorie doit être rafraîchie ?\",\n          \"name\": \"Catégorie\"\n        }\n      },\n      \"name\": \"Actualisation manuelle\"\n    }\n  }\n}\n"
  },
  {
    "path": "custom_components/deebot/translations/it.json",
    "content": "{\n  \"config\": {\n    \"abort\": {\n      \"already_configured\": \"Già configurato\",\n      \"no_supported_devices_found\": \"Non sono stati trovati dispositivi supportati\",\n      \"reauth_successful\": \"Ri-autenticazione avvenuta con successo\"\n    },\n    \"error\": {\n      \"cannot_connect\": \"Non riesco a connettermi con le API di ecovacs\",\n      \"invalid_auth\": \"Utente o password errati\",\n      \"invalid_continent\": \"La sigla contiente code deve essere di due lettere, es: eu, ww ecc...\",\n      \"invalid_country\": \"La sigla paese code deve essere di due lettere, es: it, us, uk ecc...\",\n      \"select_robots\": \"Seleziona almeno 1 robot\",\n      \"unknown\": \"Errore sconosciuto\"\n    },\n    \"step\": {\n      \"options\": {\n        \"data\": {\n          \"devices\": \"Dispositivi\"\n        }\n      },\n      \"user\": {\n        \"data\": {\n          \"continent\": \"Continente\",\n          \"country\": \"Paese\",\n          \"username\": \"E-mail o ShortID\"\n        },\n        \"data_description\": {\n          \"continent\": \"Sigla del continente. Ex.: eu, ww. Se la tua sigla paese non funziona prova con ww\",\n          \"country\": \"Sigla del paese. Es.: it, us, uk\"\n        }\n      },\n      \"user_advanced\": {\n        \"description\": \"Seleziona \\\"Bumper\\\" SOLO se hai già un'istanza Bumper. Altrimenti, seleziona \\\"Cloud\\\".\"\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "custom_components/deebot/translations/ko.json",
    "content": "{\n  \"config\": {\n    \"abort\": {\n      \"already_configured\": \"이미 구성됨\",\n      \"no_supported_devices_found\": \"지원되는 기기가 없음\",\n      \"reauth_successful\": \"재인증 성공\"\n    },\n    \"error\": {\n      \"cannot_connect\": \"ecovacs API에 연결할 수 없습니다. 로그를 확인하세요\",\n      \"invalid_auth\": \"잘못된 사용자 이름 또는 암호\",\n      \"invalid_continent\": \"대륙 코드는 2자리 코드여야 합니다\",\n      \"invalid_country\": \"국가 코드는 2자리 코드여야 합니다\",\n      \"select_robots\": \"적어도 하나 이상의 로봇청소기를 선택하세요\",\n      \"unknown\": \"알 수 없는 오류. 로그를 확인하세요\"\n    },\n    \"step\": {\n      \"options\": {\n        \"data\": {\n          \"devices\": \"기기\"\n        },\n        \"data_description\": {\n          \"devices\": \"HA에서 사용하려는 모든 기기를 선택하십시오\"\n        }\n      },\n      \"user\": {\n        \"data\": {\n          \"continent\": \"대륙\",\n          \"country\": \"국가\",\n          \"password\": \"암호\",\n          \"username\": \"이메일 또는 ShortID\"\n        },\n        \"data_description\": {\n          \"continent\": \"두 자리 대륙 코드. 예: ww, eu. 국가 코드가 작동하지 않는다면 ww로 시도하세요\",\n          \"country\": \"두자리 국가코드. 예: us, uk\"\n        }\n      },\n      \"user_advanced\": {\n        \"description\": \"이미 작동 중인 범퍼 인스턴스가 있는 경우에만 \\\"Bumper\\\"를 선택하세요. 그렇지 않으면, \\\"Cloud\\\"를 선택하세요\"\n      }\n    }\n  },\n  \"entity\": {\n    \"binary_sensor\": {\n      \"mop_attached\": {\n        \"name\": \"물걸레 장착됨\"\n      }\n    },\n    \"button\": {\n      \"life_span_brush_reset\": {\n        \"name\": \"메인 브러시 재설정\"\n      },\n      \"life_span_filter_reset\": {\n        \"name\": \"필터 재설정\"\n      },\n      \"life_span_side_brush_reset\": {\n        \"name\": \"사이드 브러시 재설정\"\n      },\n      \"relocate\": {\n        \"name\": \"재배치\"\n      }\n    },\n    \"image\": {\n      \"map\": {\n        \"name\": \"지도\"\n      }\n    },\n    \"number\": {\n      \"clean_count\": {\n        \"name\": \"청소 횟수\"\n      },\n      \"volume\": {\n        \"name\": \"볼륨\"\n      }\n    },\n    \"select\": {\n      \"water_amount\": {\n        \"name\": \"출수량\",\n        \"state\": {\n          \"high\": \"많음\",\n          \"low\": \"적음\",\n          \"medium\": \"중간\",\n          \"ultrahigh\": \"매우 많음\"\n        }\n      }\n    },\n    \"sensor\": {\n      \"battery_level\": {\n        \"name\": \"배터리 레벨\"\n      },\n      \"last_cleaning\": {\n        \"name\": \"마지막 청소\"\n      },\n      \"last_error\": {\n        \"name\": \"마지막 에러\"\n      },\n      \"life_span_brush\": {\n        \"name\": \"메인 브러시\"\n      },\n      \"life_span_filter\": {\n        \"name\": \"필터\"\n      },\n      \"life_span_side_brush\": {\n        \"name\": \"사이드 브러시\"\n      },\n      \"stats_area\": {\n        \"name\": \"면적 통계\"\n      },\n      \"stats_time\": {\n        \"name\": \"시간 통계\"\n      },\n      \"stats_total_area\": {\n        \"name\": \"총 면적 통계\"\n      },\n      \"stats_total_cleanings\": {\n        \"name\": \"총 청소 통계\"\n      },\n      \"stats_total_time\": {\n        \"name\": \"총 시간 통계\"\n      },\n      \"stats_type\": {\n        \"name\": \"유형 통계\"\n      }\n    },\n    \"switch\": {\n      \"advanced_mode\": {\n        \"name\": \"고급 모드\"\n      },\n      \"carpet_auto_fan_speed_boost\": {\n        \"name\": \"카페트 인식 흡입속도 부스트\"\n      },\n      \"clean_preference\": {\n        \"name\": \"청소 환경 설정\"\n      },\n      \"continuous_cleaning\": {\n        \"name\": \"연속 청소\"\n      },\n      \"true_detect\": {\n        \"name\": \"트루 디텍트\"\n      }\n    },\n    \"vacuum\": {\n      \"bot\": {\n        \"state_attributes\": {\n          \"fan_speed\": {\n            \"state\": {\n              \"max\": \"맥스\",\n              \"max_plus\": \"맥스+\",\n              \"normal\": \"보통\",\n              \"quiet\": \"저소음\"\n            }\n          },\n          \"last_error\": {\n            \"name\": \"마지막 에러\"\n          },\n          \"rooms\": {\n            \"name\": \"방\"\n          }\n        }\n      }\n    }\n  },\n  \"options\": {\n    \"abort\": {\n      \"cannot_connect\": \"ecovacs API에 연결할 수 없습니다. 로그를 확인하십시오\",\n      \"invalid_auth\": \"인증 실패. 먼저 재인증하세요\",\n      \"no_supported_devices_found\": \"지원되는 기기가 없음\",\n      \"unknown_get_devices\": \"모든 장치를 가져오는 중 알 수 없는 오류가 발생했습니다. 로그를 확인하세요\"\n    },\n    \"error\": {\n      \"select_robots\": \"적어도 하나 이상의 로봇청소기를 선택하세요\",\n      \"unknown\": \"알 수 없는 오류. 로그를 확인하세요\"\n    },\n    \"step\": {\n      \"init\": {\n        \"data\": {\n          \"devices\": \"기기\"\n        },\n        \"data_description\": {\n          \"devices\": \"HA에서 사용하려는 모든 기기를 선택하십시오\"\n        }\n      }\n    }\n  },\n  \"selector\": {\n    \"refresh_category\": {\n      \"options\": {\n        \"battery\": \"배터리\",\n        \"clean_logs\": \"로그 삭제\",\n        \"error\": \"에러\",\n        \"fan_speed\": \"흡입 속도\",\n        \"life_spans\": \"메인 브러시 수명\",\n        \"map\": \"지도\",\n        \"rooms\": \"방\",\n        \"stats\": \"통계\",\n        \"status\": \"상태\",\n        \"water\": \"물\"\n      }\n    }\n  },\n  \"services\": {\n    \"refresh\": {\n      \"description\": \"선택한 카테고리에 대한 새로고침을 수동으로 요청합니다\",\n      \"fields\": {\n        \"category\": {\n          \"description\": \"어떤 카테고리를 새로고침해야 합니까?\",\n          \"name\": \"카테고리\"\n        }\n      },\n      \"name\": \"수동 새로고침\"\n    }\n  }\n}\n"
  },
  {
    "path": "custom_components/deebot/translations/pt-BR.json",
    "content": "{\n  \"config\": {\n    \"abort\": {\n      \"already_configured\": \"Já está configurado\",\n      \"no_supported_devices_found\": \"Nenhum dispositivo compatível encontrado\",\n      \"reauth_successful\": \"A reautenticação foi bem-sucedida\"\n    },\n    \"error\": {\n      \"cannot_connect\": \"Não é possível conectar à API ecovacs. Por favor, verifique os registros\",\n      \"invalid_auth\": \"nome de usuário ou senha inválidos\",\n      \"invalid_continent\": \"O código do continente deve ser um código de duas letras\",\n      \"invalid_country\": \"O código do país deve ser um código de duas letras\",\n      \"select_robots\": \"Selecione pelo menos 1 robô\",\n      \"unknown\": \"Erro desconhecido. Por favor, verifique os registros\"\n    },\n    \"step\": {\n      \"options\": {\n        \"data\": {\n          \"devices\": \"Dispositivos\"\n        }\n      },\n      \"user\": {\n        \"data\": {\n          \"continent\": \"Continente\",\n          \"country\": \"País\",\n          \"password\": \"Senha\",\n          \"username\": \"E-mail ou ShortID\"\n        },\n        \"data_description\": {\n          \"continent\": \"O código do continente de duas letras. Ex.: ww, eu. Se o código do seu país não estiver funcionando, tente ww\",\n          \"country\": \"O código do país de duas letras. Ex.: us, uk\"\n        }\n      },\n      \"user_advanced\": {\n        \"description\": \"Selecione \\\"Bumper\\\" SOMENTE se você já tiver uma instância de bumper em funcionamento. Caso contrário, selecione \\\"Cloud\\\" por favor.\"\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "custom_components/deebot/translations/ru.json",
    "content": "{\n  \"config\": {\n    \"abort\": {\n      \"already_configured\": \"Уже настроено\"\n    },\n    \"error\": {\n      \"cannot_connect\": \"Не удается подключиться к API ecovacs\",\n      \"invalid_auth\": \"Неверное имя пользователя или пароль\",\n      \"invalid_continent\": \"Код континента должен быть двухбуквенным, например: eu, ww, итд \",\n      \"invalid_country\": \"Код страны должен быть двухбуквенным, например: ru, us, итд \",\n      \"select_robots\": \"Выберите хотя бы 1 робота\",\n      \"unknown\": \"Неизвестная ошибка\"\n    },\n    \"step\": {\n      \"options\": {\n        \"data\": {\n          \"devices\": \"Устройства\"\n        }\n      },\n      \"user\": {\n        \"data\": {\n          \"continent\": \"Континент\",\n          \"country\": \"Страна\",\n          \"password\": \"Пароль\",\n          \"username\": \"E-mail или Ecovacs ID\"\n        }\n      },\n      \"user_advanced\": {\n        \"description\": \"Выберите \\\"Bumper\\\" ТОЛЬКО, если у вас уже есть работающий экземпляр bumper. В противном случае выберайте \\\"Cloud\\\".\"\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "custom_components/deebot/translations/zh-Hans.json",
    "content": "{\n  \"config\": {\n    \"abort\": {\n      \"already_configured\": \"已存在现有配置\",\n      \"no_supported_devices_found\": \"未找到支持的设备\",\n      \"reauth_successful\": \"重新认证成功\"\n    },\n    \"error\": {\n      \"cannot_connect\": \"无法连接科沃斯API，请检查日志\",\n      \"invalid_auth\": \"用户名或密码错误\",\n      \"invalid_continent\": \"地区代码应是两个字母组成\",\n      \"invalid_country\": \"国家代码应是两个字母组成\",\n      \"select_robots\": \"请至少选择1个机器人\",\n      \"unknown\": \"未知错误。请检查日志\"\n    },\n    \"step\": {\n      \"options\": {\n        \"data\": {\n          \"devices\": \"设备\"\n        },\n        \"data_description\": {\n          \"devices\": \"请选择您要在 HA 中使用的所有设备。\"\n        }\n      },\n      \"user\": {\n        \"data\": {\n          \"continent\": \"地区\",\n          \"country\": \"国家\",\n          \"password\": \"密码\",\n          \"username\": \"电子邮件地址或科沃斯ID\"\n        },\n        \"data_description\": {\n          \"continent\": \"2位地区代码。例如: ww, eu, as.如果您的国家代码不起作用请尝试使用 ww\",\n          \"country\": \"2位地区代码。例如: us, uk, cn\"\n        }\n      },\n      \"user_advanced\": {\n        \"description\": \"只有当你有一个有效的缓冲器实例时，才推荐选择\\\"Bumper\\\" 。否则，请选择\\\"Cloud\\\"。\"\n      }\n    }\n  },\n  \"options\": {\n    \"abort\": {\n      \"cannot_connect\": \"无法连接科沃斯API。 请检查日志\",\n      \"invalid_auth\": \"认证失败。 请先重新认证\",\n      \"no_supported_devices_found\": \"未找到支持的设备\",\n      \"unknown_get_devices\": \"获取所有设备时出现未知错误。 请检查日志\"\n    },\n    \"error\": {\n      \"select_robots\": \"请至少选择1个机器人\",\n      \"unknown\": \"未知错误。请检查日志\"\n    },\n    \"step\": {\n      \"init\": {\n        \"data\": {\n          \"devices\": \"设备\"\n        },\n        \"data_description\": {\n          \"devices\": \"请选择您要在 HA 中使用的所有设备。\"\n        }\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "custom_components/deebot/util.py",
    "content": "\"\"\"Util module.\"\"\"\nimport dataclasses\nfrom enum import Enum\nfrom typing import Any\n\nfrom deebot_client.util import DisplayNameIntEnum\nfrom homeassistant.core import HomeAssistant\nfrom homeassistant.util import uuid\n\n\ndef get_bumper_device_id(hass: HomeAssistant) -> str:\n    \"\"\"Return bumper device id.\"\"\"\n    try:\n        location_name = hass.config.location_name.strip().replace(\" \", \"_\")\n    except Exception:  # pylint: disable=broad-except\n        location_name = \"\"\n    return f\"Deebot-4-HA_{location_name}_{uuid.random_uuid_hex()[:4]}\"\n\n\ndef dataclass_to_dict(obj: Any) -> dict[str, Any]:\n    \"\"\"Convert dataclass to dict and remove None fields.\"\"\"\n    dic = dataclasses.asdict(obj)\n    for key, value in dic.copy().items():\n        if value is None:\n            dic.pop(key)\n        elif isinstance(value, Enum):\n            if isinstance(value, DisplayNameIntEnum):\n                dic[key] = value.display_name\n            else:\n                dic[key] = value.value\n\n    return dic\n"
  },
  {
    "path": "custom_components/deebot/vacuum.py",
    "content": "\"\"\"Support for Deebot Vacuums.\"\"\"\nimport logging\nfrom collections.abc import Mapping, Sequence\nfrom typing import Any\n\nimport voluptuous as vol\nfrom deebot_client.capabilities import Capabilities\nfrom deebot_client.device import Device\nfrom deebot_client.events import (\n    BatteryEvent,\n    CustomCommandEvent,\n    FanSpeedEvent,\n    ReportStatsEvent,\n    RoomsEvent,\n    StateEvent,\n)\nfrom deebot_client.models import CleanAction, CleanMode, Room, State\nfrom homeassistant.components.vacuum import (\n    STATE_CLEANING,\n    STATE_DOCKED,\n    STATE_ERROR,\n    STATE_IDLE,\n    STATE_PAUSED,\n    STATE_RETURNING,\n    StateVacuumEntity,\n    StateVacuumEntityDescription,\n    VacuumEntityFeature,\n)\nfrom homeassistant.config_entries import ConfigEntry\nfrom homeassistant.core import HomeAssistant\nfrom homeassistant.helpers import entity_platform\nfrom homeassistant.helpers.config_validation import make_entity_service_schema\nfrom homeassistant.helpers.entity_platform import AddEntitiesCallback\nfrom homeassistant.helpers.issue_registry import IssueSeverity, async_create_issue\nfrom homeassistant.util import slugify\n\nfrom .const import (\n    DOMAIN,\n    EVENT_CLEANING_JOB,\n    EVENT_CUSTOM_COMMAND,\n    REFRESH_MAP,\n    REFRESH_STR_TO_EVENT_DTO,\n)\nfrom .controller import DeebotController\nfrom .entity import DeebotEntity\nfrom .util import dataclass_to_dict\n\n_LOGGER = logging.getLogger(__name__)\n\n_STATE_TO_VACUUM_STATE = {\n    State.IDLE: STATE_IDLE,\n    State.CLEANING: STATE_CLEANING,\n    State.RETURNING: STATE_RETURNING,\n    State.DOCKED: STATE_DOCKED,\n    State.ERROR: STATE_ERROR,\n    State.PAUSED: STATE_PAUSED,\n}\n\n\n# Must be kept in sync with services.yaml\nSERVICE_REFRESH = \"refresh\"\nSERVICE_REFRESH_CATEGORY = \"category\"\nSERVICE_REFRESH_SCHEMA = make_entity_service_schema(\n    {\n        vol.Required(SERVICE_REFRESH_CATEGORY): vol.In(\n            [*REFRESH_STR_TO_EVENT_DTO.keys(), REFRESH_MAP]\n        )\n    }\n)\n\n\nasync def async_setup_entry(\n    hass: HomeAssistant,\n    config_entry: ConfigEntry,\n    async_add_entities: AddEntitiesCallback,\n) -> None:\n    \"\"\"Add entities for passed config_entry in HA.\"\"\"\n    controller: DeebotController = hass.data[DOMAIN][config_entry.entry_id]\n\n    def vacuum_entity_generator(\n        device: Device,\n    ) -> Sequence[DeebotVacuum]:\n        return [DeebotVacuum(device)]\n\n    controller.register_platform_add_entities_generator(\n        async_add_entities, vacuum_entity_generator\n    )\n\n    platform = entity_platform.async_get_current_platform()\n\n    platform.async_register_entity_service(\n        SERVICE_REFRESH,\n        SERVICE_REFRESH_SCHEMA,\n        \"service_refresh\",\n    )\n\n\n_ATTR_ROOMS = \"rooms\"\n\n\nclass DeebotVacuum(\n    DeebotEntity[Capabilities, StateVacuumEntityDescription],\n    StateVacuumEntity,  # type: ignore\n):\n    \"\"\"Deebot Vacuum.\"\"\"\n\n    _unrecorded_attributes = frozenset({_ATTR_ROOMS})\n\n    _attr_supported_features = (\n        VacuumEntityFeature.PAUSE\n        | VacuumEntityFeature.STOP\n        | VacuumEntityFeature.RETURN_HOME\n        | VacuumEntityFeature.FAN_SPEED\n        | VacuumEntityFeature.BATTERY\n        | VacuumEntityFeature.SEND_COMMAND\n        | VacuumEntityFeature.LOCATE\n        | VacuumEntityFeature.STATE\n        | VacuumEntityFeature.START\n    )\n\n    def __init__(self, device: Device):\n        \"\"\"Initialize the Deebot Vacuum.\"\"\"\n        capabilities = device.capabilities\n        super().__init__(\n            device,\n            capabilities,\n            StateVacuumEntityDescription(key=\"\", translation_key=\"bot\", name=None),\n        )\n\n        self._rooms: list[Room] = []\n\n        self._attr_fan_speed_list = [\n            level.display_name for level in capabilities.fan_speed.types\n        ]\n\n    async def async_added_to_hass(self) -> None:\n        \"\"\"Set up the event listeners now that hass is ready.\"\"\"\n        await super().async_added_to_hass()\n\n        async def on_battery(event: BatteryEvent) -> None:\n            self._attr_battery_level = event.value\n            self.async_write_ha_state()\n\n        async def on_custom_command(event: CustomCommandEvent) -> None:\n            self.hass.bus.fire(EVENT_CUSTOM_COMMAND, dataclass_to_dict(event))\n\n        async def on_fan_speed(event: FanSpeedEvent) -> None:\n            self._attr_fan_speed = event.speed.display_name\n            self.async_write_ha_state()\n\n        async def on_report_stats(event: ReportStatsEvent) -> None:\n            self.hass.bus.fire(EVENT_CLEANING_JOB, dataclass_to_dict(event))\n\n        async def on_rooms(event: RoomsEvent) -> None:\n            self._rooms = event.rooms\n            self.async_write_ha_state()\n\n        async def on_status(event: StateEvent) -> None:\n            self._attr_state = _STATE_TO_VACUUM_STATE[event.state]\n            self.async_write_ha_state()\n\n        self._subscribe(self._capability.battery.event, on_battery)\n        self._subscribe(self._capability.fan_speed.event, on_fan_speed)\n        self._subscribe(self._capability.stats.report.event, on_report_stats)\n        self._subscribe(self._capability.state.event, on_status)\n\n        if custom := self._capability.custom:\n            self._subscribe(custom.event, on_custom_command)\n        if map_caps := self._capability.map:\n            self._subscribe(map_caps.rooms.event, on_rooms)\n\n    @property\n    def extra_state_attributes(self) -> Mapping[str, Any] | None:\n        \"\"\"Return entity specific state attributes.\n\n        Implemented by platform classes. Convention for attribute names\n        is lowercase snake_case.\n        \"\"\"\n        attributes: dict[str, Any] = {}\n        rooms: dict[str, Any] = {}\n        for room in self._rooms:\n            # convert room name to snake_case to meet the convention\n            room_name = slugify(room.name)\n            room_values = rooms.get(room_name)\n            if room_values is None:\n                rooms[room_name] = room.id\n            elif isinstance(room_values, list):\n                room_values.append(room.id)\n            else:\n                # Convert from int to list\n                rooms[room_name] = [room_values, room.id]\n\n        if rooms:\n            attributes[_ATTR_ROOMS] = rooms\n\n        return attributes\n\n    async def async_set_fan_speed(self, fan_speed: str, **kwargs: Any) -> None:\n        \"\"\"Set fan speed.\"\"\"\n        await self._device.execute_command(self._capability.fan_speed.set(fan_speed))\n\n    async def async_return_to_base(self, **kwargs: Any) -> None:\n        \"\"\"Set the vacuum cleaner to return to the dock.\"\"\"\n        await self._device.execute_command(self._capability.charge.execute())\n\n    async def async_stop(self, **kwargs: Any) -> None:\n        \"\"\"Stop the vacuum cleaner.\"\"\"\n        await self._clean_command(CleanAction.STOP)\n\n    async def async_pause(self) -> None:\n        \"\"\"Pause the vacuum cleaner.\"\"\"\n        await self._clean_command(CleanAction.PAUSE)\n\n    async def async_start(self) -> None:\n        \"\"\"Start the vacuum cleaner.\"\"\"\n        await self._clean_command(CleanAction.START)\n\n    async def _clean_command(self, action: CleanAction) -> None:\n        await self._device.execute_command(\n            self._capability.clean.action.command(action)\n        )\n\n    async def async_locate(self, **kwargs: Any) -> None:\n        \"\"\"Locate the vacuum cleaner.\"\"\"\n        await self._device.execute_command(self._capability.play_sound.execute())\n\n    async def async_send_command(\n        self, command: str, params: dict[str, Any] | None = None, **kwargs: Any\n    ) -> None:\n        \"\"\"Send a command to a vacuum cleaner.\"\"\"\n        _LOGGER.debug(\"async_send_command %s with %s\", command, params)\n\n        if command in [\"spot_area\", \"custom_area\"]:\n            if params is None:\n                raise RuntimeError(\"Params are required!\")\n\n            if command in \"spot_area\":\n                await self._device.execute_command(\n                    self._capability.clean.action.area(\n                        CleanMode.SPOT_AREA,\n                        str(params[\"rooms\"]),\n                        params.get(\"cleanings\", 1),\n                    )\n                )\n            elif command == \"custom_area\":\n                await self._device.execute_command(\n                    self._capability.clean.action.area(\n                        CleanMode.CUSTOM_AREA,\n                        str(params[\"coordinates\"]),\n                        params.get(\"cleanings\", 1),\n                    )\n                )\n        else:\n            await self._device.execute_command(\n                self._capability.custom.set(command, params)\n            )\n\n    async def service_refresh(self, category: str) -> None:\n        \"\"\"Service to manually refresh.\"\"\"\n        _LOGGER.warning(\n            'Service \"deebot.refresh\" is deprecated. To refresh an entity please use \"homeassistant.update_entity\" on the respective entity instead'\n        )\n        async_create_issue(\n            self.hass,\n            DOMAIN,\n            \"deprecated_service_refresh\",\n            is_fixable=True,\n            severity=IssueSeverity.WARNING,\n            translation_key=\"deprecated_service_refresh\",\n        )\n\n        _LOGGER.debug(\"Manually refresh %s\", category)\n        event = REFRESH_STR_TO_EVENT_DTO.get(category, None)\n        if event:\n            self._device.events.request_refresh(event)\n        elif category == REFRESH_MAP:\n            self._device.map.refresh()\n        else:\n            _LOGGER.warning(\n                'Service \"refresh\" called with unknown category: %s', category\n            )\n"
  },
  {
    "path": "hacs.json",
    "content": "{\n  \"filename\": \"deebot.zip\",\n  \"homeassistant\": \"2024.1.0b0\",\n  \"name\": \"Deebot 4 Home Assistant\",\n  \"render_readme\": true,\n  \"zip_release\": true\n}\n"
  },
  {
    "path": "mypy.ini",
    "content": "[mypy]\npython_version = 3.11\nshow_error_codes = true\nfollow_imports = silent\nignore_missing_imports = true\nstrict_equality = true\nwarn_incomplete_stub = true\nwarn_redundant_casts = true\nwarn_unused_configs = true\nwarn_unused_ignores = true\ncheck_untyped_defs = true\ndisallow_incomplete_defs = true\ndisallow_subclassing_any = true\ndisallow_untyped_calls = true\ndisallow_untyped_decorators = true\ndisallow_untyped_defs = true\nno_implicit_optional = true\nwarn_return_any = true\nwarn_unreachable = true"
  },
  {
    "path": "pylintrc",
    "content": "[MASTER]\nignore=tests\n# Use a conservative default here; 2 should speed up most setups and not hurt\n# any too bad. Override on command line as appropriate.\njobs=2\n\n# Return non-zero exit code if any of these messages/categories are detected,\n# even if score is above --fail-under value. Syntax same as enable. Messages\n# specified are enabled, while categories only check already-enabled messages.\nfail-on=\n  useless-suppression,\n\n# Specify a score threshold to be exceeded before program exits with error.\nfail-under=10.0\n\n# List of plugins (as comma separated values of python module names) to load,\n# usually to register additional checkers.\n# load-plugins=\n\n# Pickle collected data for later comparisons.\npersistent=no\n\n# A comma-separated list of package or module names from where C extensions may\n# be loaded. Extensions are loading into the active Python interpreter and may\n# run arbitrary code. (This is an alternative name to extension-pkg-allow-list\n# for backward compatibility.)\nextension-pkg-whitelist=ciso8601,\n                        cv2\n\n\n[BASIC]\ngood-names=i,j,k,ex,_,T,x,y,id\n\n[MESSAGES CONTROL]\n# Reasons disabled:\n# format - handled by black\n# duplicate-code - unavoidable\n# cyclic-import - doesn't test if both import on load\n# too-many-* - are not enforced for the sake of readability\n# abstract-method - with intro of async there are always methods missing\n# inconsistent-return-statements - doesn't handle raise\n# wrong-import-order - isort guards this\n# unexpected-keyword-arg - to many false positives\ndisable=\n  format,\n  abstract-method,\n  cyclic-import,\n  duplicate-code,\n  inconsistent-return-statements,\n  too-many-instance-attributes,\n  wrong-import-order,\n  too-few-public-methods,\n  unexpected-keyword-arg\n\n# enable useless-suppression temporarily every now and then to clean them up\nenable=\n  useless-suppression,\n  use-symbolic-message-instead,\n\n[REPORTS]\nscore=no\n\n[REFACTORING]\n\n# Maximum number of nested blocks for function / method body\nmax-nested-blocks=5\n\n# Complete name of functions that never returns. When checking for\n# inconsistent-return-statements if a never returning function is called then\n# it will be considered as an explicit return statement and no message will be\n# printed.\nnever-returning-functions=sys.exit,argparse.parse_error\n\n[FORMAT]\nexpected-line-ending-format=LF\n\n[EXCEPTIONS]\n\n# Exceptions that will emit a warning when being caught. Defaults to\n# \"BaseException, Exception\".\novergeneral-exceptions=builtins.BaseException,\n                       builtins.Exception\n\n"
  },
  {
    "path": "pyproject.toml",
    "content": "[tool.black]\ntarget-version = ['py311']\nsafe = true"
  },
  {
    "path": "requirements.txt",
    "content": "# if code from specific branch is needed\n#git+https://github.com/DeebotUniverse/client.py@dev#deebot-client==4.2.0dev0\ndeebot-client==5.1.0\n\nhomeassistant>=2024.1.0b0\nmypy==1.8.0\n\nnumpy>=1.23.2\npre-commit==3.6.0\npylint==3.0.3\n\n#pytest-homeassistant-custom-component==0.4.4\n\n# uses in deebbot-client, adding for mypi\ntypes-cachetools\n"
  },
  {
    "path": "scripts/coverage",
    "content": "#!/usr/bin/env bash\n\nset -e\n\ncd \"$(dirname \"$0\")/..\"\n\nbash scripts/test > /dev/null\npython3 -m \\\n    coverage \\\n    report \\\n    --skip-covered"
  },
  {
    "path": "scripts/develop",
    "content": "#!/usr/bin/env bash\n\nset -e\n\ncd \"$(dirname \"$0\")/..\"\n\nif [ ! -f \"${PWD}/config/configuration.yaml\" ]; then\n  mkdir -p \"${PWD}/config\"\n  hass --config \"${PWD}/config\" --script ensure_config\n  echo \"Creating default configuration.\"\n  echo \"\ndefault_config:\n\nlogger:\n  default: info\n  logs:\n    homeassistant.components.vacuum: debug\n    custom_components.deebot: debug\n    deebot_client: debug\n\n# If you need to debug uncomment the line below (doc: https://www.home-assistant.io/integrations/debugpy/)\ndebugpy:\n#   wait: true\n\" >> \"${PWD}/config/configuration.yaml\"\nfi\n\n# Set the python path to include our custom_components directory\nexport PYTHONPATH=\"${PYTHONPATH}:${PWD}/custom_components\"\n\n# Start Home Assistant\nhass --config \"${PWD}/config\" --debug"
  },
  {
    "path": "scripts/install/pip_packages",
    "content": "#!/usr/bin/env bash\n\nset -e\n\npython3 -m pip \\\n    install \\\n    --upgrade \\\n    --disable-pip-version-check \\\n    \"${@}\"\n\n"
  },
  {
    "path": "scripts/lint",
    "content": "#!/usr/bin/env bash\n\nset -e\n\ncd \"$(dirname \"$0\")/..\"\n\npre-commit install-hooks;\npre-commit run --hook-stage manual --all-files;\n\n#bellybutton lint\n\n#vulture . --min-confidence 75 --ignore-names policy\n"
  },
  {
    "path": "scripts/run-in-env.sh",
    "content": "#!/usr/bin/env bash\nset -eu\n\n# Activate pyenv and virtualenv if present, then run the specified command\n\n# pyenv, pyenv-virtualenv\nif [ -s .python-version ]; then\n    PYENV_VERSION=$(head -n 1 .python-version)\n    export PYENV_VERSION\nfi\n\n# other common virtualenvs\nmy_path=$(git rev-parse --show-toplevel)\n\nfor venv in venv .venv .; do\n  if [ -f \"${my_path}/${venv}/bin/activate\" ]; then\n    . \"${my_path}/${venv}/bin/activate\"\n  fi\ndone\n\nexec \"$@\"\n"
  },
  {
    "path": "scripts/setup",
    "content": "#!/usr/bin/env bash\n\nset -e\n\ncd \"$(dirname \"$0\")/..\"\n\nscripts/install/pip_packages \"pip\"\nscripts/install/pip_packages setuptools wheel\nscripts/install/pip_packages --requirement requirements.txt\npre-commit install\n"
  },
  {
    "path": "scripts/test",
    "content": "#!/usr/bin/env bash\n\nset -e\n\ncd \"$(dirname \"$0\")/..\"\n\npython3 -m \\\n    pytest \\\n    tests \\\n    -rxf -x -v -l \\\n    --cov=./ \\\n    --cov-report=xml\n\n"
  },
  {
    "path": "setup.cfg",
    "content": "[flake8]\nexclude = .venv,.git,.tox,docs,venv,bin,lib,deps,build\ndoctests = True\n# To work with Black\nmax-line-length = 88\n# E501: line too long\n# W503: Line break occurred before a binary operator\n# E203: Whitespace before ':'\n# D202 No blank lines allowed after function docstring\n# D107 Missing docstring in __init__\nignore =\n    E501,\n    W503,\n    E203,\n    D202,\n    D107\n\n[isort]\n# https://github.com/timothycrosley/isort\n# https://github.com/timothycrosley/isort/wiki/isort-Settings\nprofile = black"
  },
  {
    "path": "tests/README.md",
    "content": "# Why?\n\nWhile tests aren't required to publish a custom component for Home Assistant, they will generally make development easier because good tests will expose when changes you want to make to the component logic will break expected functionality. Home Assistant uses [`pytest`](https://docs.pytest.org/en/latest/) for its tests, and the tests that have been included are modeled after tests that are written for core Home Assistant integrations. These tests pass with 100% coverage (unless something has changed ;) ) and have comments to help you understand the purpose of different parts of the test.\n\n# Getting Started\n\nTo begin, it is recommended to create a virtual environment to install dependencies:\n\n```bash\npython3 -m venv venv\nsource venv/bin/activate\n```\n\nYou can then install the dependencies that will allow you to run tests:\n`pip3 install -r requirements_test.txt.`\n\nThis will install `homeassistant`, `pytest`, and `pytest-homeassistant-custom-component`, a plugin which allows you to leverage helpers that are available in Home Assistant for core integration tests.\n\n# Useful commands\n\n| Command                                                                                               | Description                                                                                                                                                                                                                                                                       |\n| ----------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `pytest tests/`                                                                                       | This will run all tests in `tests/` and tell you how many passed/failed                                                                                                                                                                                                           |\n| `pytest --durations=10 --cov-report term-missing --cov=custom_components.integration_blueprint tests` | This tells `pytest` that your target module to test is `custom_components.integration_blueprint` so that it can give you a [code coverage](https://en.wikipedia.org/wiki/Code_coverage) summary, including % of code that was executed and the line numbers of missed executions. |\n| `pytest tests/test_init.py -k test_setup_unload_and_reload_entry`                                     | Runs the `test_setup_unload_and_reload_entry` test function located in `tests/test_init.py`                                                                                                                                                                                       |\n"
  },
  {
    "path": "tests/__init__.py",
    "content": "\"\"\"Tests for deebot integration.\"\"\"\n"
  },
  {
    "path": "tests/conftest.py",
    "content": "\"\"\"Global fixtures for integration_blueprint integration.\"\"\"\n# Fixtures allow you to replace functions with a Mock object. You can perform\n# many options via the Mock to reflect a particular behavior from the original\n# function that you want to see without going through the function's actual logic.\n# Fixtures can either be passed into tests as parameters, or if autouse=True, they\n# will automatically be used across all tests.\n#\n# Fixtures that are defined in conftest.py are available across all tests. You can also\n# define fixtures within a particular test file to scope them locally.\n#\n# pytest_homeassistant_custom_component provides some fixtures that are provided by\n# Home Assistant core. You can find those fixture definitions here:\n# https://github.com/MatthewFlamm/pytest-homeassistant-custom-component/blob/master/pytest_homeassistant_custom_component/common.py\n#\n# See here for more info: https://docs.pytest.org/en/latest/fixture.html (note that\n# pytest includes fixtures OOB which you can use as defined on this page)\nfrom unittest.mock import patch\n\nimport pytest\n\npytest_plugins = \"pytest_homeassistant_custom_component\"\n\n\n# This fixture enables loading custom integrations in all tests.\n# Remove to enable selective use of this fixture\n@pytest.fixture(autouse=True)\ndef auto_enable_custom_integrations(enable_custom_integrations):\n    yield\n\n\n# This fixture is used to prevent HomeAssistant from attempting to create and dismiss persistent\n# notifications. These calls would fail without this fixture since the persistent_notification\n# integration is never loaded during a test.\n@pytest.fixture(name=\"skip_notifications\", autouse=True)\ndef skip_notifications_fixture():\n    \"\"\"Skip notification calls.\"\"\"\n    with patch(\"homeassistant.components.persistent_notification.async_create\"), patch(\n        \"homeassistant.components.persistent_notification.async_dismiss\"\n    ):\n        yield\n\n\n# This fixture, when used, will result in calls to async_get_data to return None. To have the call\n# return a value, we would add the `return_value=<VALUE_TO_RETURN>` parameter to the patch call.\n@pytest.fixture(name=\"bypass_get_data\")\ndef bypass_get_data_fixture():\n    \"\"\"Skip calls to get data from API.\"\"\"\n    with patch(\n        \"custom_components.integration_blueprint.IntegrationBlueprintApiClient.async_get_data\"\n    ):\n        yield\n\n\n# In this fixture, we are forcing calls to async_get_data to raise an Exception. This is useful\n# for exception handling.\n@pytest.fixture(name=\"error_on_get_data\")\ndef error_get_data_fixture():\n    \"\"\"Simulate error when retrieving data from API.\"\"\"\n    with patch(\n        \"custom_components.integration_blueprint.IntegrationBlueprintApiClient.async_get_data\",\n        side_effect=Exception,\n    ):\n        yield\n"
  },
  {
    "path": "translations.schema.json",
    "content": "{\n  \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n  \"additionalProperties\": false,\n  \"definitions\": {\n    \"translation_name\": {\n      \"additionalProperties\": false,\n      \"properties\": {\n        \"name\": {\n          \"type\": \"string\"\n        }\n      },\n      \"type\": \"object\"\n    }\n  },\n  \"properties\": {\n    \"config\": {\n      \"additionalProperties\": false,\n      \"properties\": {\n        \"abort\": {\n          \"additionalProperties\": false,\n          \"properties\": {\n            \"already_configured\": {\n              \"type\": \"string\"\n            },\n            \"no_supported_devices_found\": {\n              \"type\": \"string\"\n            },\n            \"reauth_successful\": {\n              \"type\": \"string\"\n            }\n          },\n          \"type\": \"object\"\n        },\n        \"error\": {\n          \"additionalProperties\": false,\n          \"properties\": {\n            \"cannot_connect\": {\n              \"type\": \"string\"\n            },\n            \"invalid_auth\": {\n              \"type\": \"string\"\n            },\n            \"invalid_continent\": {\n              \"type\": \"string\"\n            },\n            \"invalid_country\": {\n              \"type\": \"string\"\n            },\n            \"select_robots\": {\n              \"type\": \"string\"\n            },\n            \"unknown\": {\n              \"type\": \"string\"\n            }\n          },\n          \"type\": \"object\"\n        },\n        \"step\": {\n          \"additionalProperties\": false,\n          \"properties\": {\n            \"options\": {\n              \"additionalProperties\": false,\n              \"properties\": {\n                \"data\": {\n                  \"additionalProperties\": false,\n                  \"properties\": {\n                    \"devices\": {\n                      \"type\": \"string\"\n                    }\n                  },\n                  \"type\": \"object\"\n                },\n                \"data_description\": {\n                  \"additionalProperties\": false,\n                  \"properties\": {\n                    \"devices\": {\n                      \"type\": \"string\"\n                    }\n                  },\n                  \"type\": \"object\"\n                }\n              },\n              \"type\": \"object\"\n            },\n            \"user\": {\n              \"additionalProperties\": false,\n              \"properties\": {\n                \"data\": {\n                  \"additionalProperties\": false,\n                  \"properties\": {\n                    \"continent\": {\n                      \"type\": \"string\"\n                    },\n                    \"country\": {\n                      \"type\": \"string\"\n                    },\n                    \"password\": {\n                      \"type\": \"string\"\n                    },\n                    \"username\": {\n                      \"type\": \"string\"\n                    }\n                  },\n                  \"type\": \"object\"\n                },\n                \"data_description\": {\n                  \"additionalProperties\": false,\n                  \"properties\": {\n                    \"continent\": {\n                      \"type\": \"string\"\n                    },\n                    \"country\": {\n                      \"type\": \"string\"\n                    }\n                  },\n                  \"type\": \"object\"\n                }\n              },\n              \"type\": \"object\"\n            },\n            \"user_advanced\": {\n              \"additionalProperties\": false,\n              \"properties\": {\n                \"description\": {\n                  \"type\": \"string\"\n                }\n              },\n              \"type\": \"object\"\n            }\n          },\n          \"type\": \"object\"\n        }\n      },\n      \"type\": \"object\"\n    },\n    \"entity\": {\n      \"additionalProperties\": false,\n      \"properties\": {\n        \"binary_sensor\": {\n          \"additionalProperties\": false,\n          \"properties\": {\n            \"mop_attached\": {\n              \"$ref\": \"#/definitions/translation_name\"\n            }\n          },\n          \"type\": \"object\"\n        },\n        \"button\": {\n          \"additionalProperties\": false,\n          \"properties\": {\n            \"life_span_brush_reset\": {\n              \"$ref\": \"#/definitions/translation_name\"\n            },\n            \"life_span_filter_reset\": {\n              \"$ref\": \"#/definitions/translation_name\"\n            },\n            \"life_span_side_brush_reset\": {\n              \"$ref\": \"#/definitions/translation_name\"\n            },\n            \"relocate\": {\n              \"$ref\": \"#/definitions/translation_name\"\n            }\n          },\n          \"type\": \"object\"\n        },\n        \"image\": {\n          \"additionalProperties\": false,\n          \"properties\": {\n            \"map\": {\n              \"$ref\": \"#/definitions/translation_name\"\n            }\n          },\n          \"type\": \"object\"\n        },\n        \"number\": {\n          \"additionalProperties\": false,\n          \"properties\": {\n            \"clean_count\": {\n              \"$ref\": \"#/definitions/translation_name\"\n            },\n            \"volume\": {\n              \"$ref\": \"#/definitions/translation_name\"\n            }\n          },\n          \"type\": \"object\"\n        },\n        \"select\": {\n          \"additionalProperties\": false,\n          \"properties\": {\n            \"water_amount\": {\n              \"additionalProperties\": false,\n              \"properties\": {\n                \"name\": {\n                  \"type\": \"string\"\n                },\n                \"state\": {\n                  \"additionalProperties\": false,\n                  \"properties\": {\n                    \"high\": {\n                      \"type\": \"string\"\n                    },\n                    \"low\": {\n                      \"type\": \"string\"\n                    },\n                    \"medium\": {\n                      \"type\": \"string\"\n                    },\n                    \"ultrahigh\": {\n                      \"type\": \"string\"\n                    }\n                  },\n                  \"type\": \"object\"\n                }\n              },\n              \"type\": \"object\"\n            },\n            \"work_mode\": {\n              \"additionalProperties\": false,\n              \"properties\": {\n                \"name\": {\n                  \"type\": \"string\"\n                },\n                \"state\": {\n                  \"additionalProperties\": false,\n                  \"properties\": {\n                    \"mop\": {\n                      \"type\": \"string\"\n                    },\n                    \"mop_after_vacuum\": {\n                      \"type\": \"string\"\n                    },\n                    \"vacuum\": {\n                      \"type\": \"string\"\n                    },\n                    \"vacuum_and_mop\": {\n                      \"type\": \"string\"\n                    }\n                  },\n                  \"type\": \"object\"\n                }\n              },\n              \"type\": \"object\"\n            }\n          },\n          \"type\": \"object\"\n        },\n        \"sensor\": {\n          \"additionalProperties\": false,\n          \"properties\": {\n            \"battery_level\": {\n              \"$ref\": \"#/definitions/translation_name\"\n            },\n            \"last_cleaning\": {\n              \"$ref\": \"#/definitions/translation_name\"\n            },\n            \"last_error\": {\n              \"$ref\": \"#/definitions/translation_name\"\n            },\n            \"life_span_brush\": {\n              \"$ref\": \"#/definitions/translation_name\"\n            },\n            \"life_span_filter\": {\n              \"$ref\": \"#/definitions/translation_name\"\n            },\n            \"life_span_side_brush\": {\n              \"$ref\": \"#/definitions/translation_name\"\n            },\n            \"stats_area\": {\n              \"$ref\": \"#/definitions/translation_name\"\n            },\n            \"stats_time\": {\n              \"$ref\": \"#/definitions/translation_name\"\n            },\n            \"stats_total_area\": {\n              \"$ref\": \"#/definitions/translation_name\"\n            },\n            \"stats_total_cleanings\": {\n              \"$ref\": \"#/definitions/translation_name\"\n            },\n            \"stats_total_time\": {\n              \"$ref\": \"#/definitions/translation_name\"\n            },\n            \"stats_type\": {\n              \"$ref\": \"#/definitions/translation_name\"\n            },\n            \"wifi_ip\": {\n              \"$ref\": \"#/definitions/translation_name\"\n            },\n            \"wifi_rssi\": {\n              \"$ref\": \"#/definitions/translation_name\"\n            },\n            \"wifi_ssid\": {\n              \"$ref\": \"#/definitions/translation_name\"\n            }\n          },\n          \"type\": \"object\"\n        },\n        \"switch\": {\n          \"additionalProperties\": false,\n          \"properties\": {\n            \"advanced_mode\": {\n              \"$ref\": \"#/definitions/translation_name\"\n            },\n            \"carpet_auto_fan_speed_boost\": {\n              \"$ref\": \"#/definitions/translation_name\"\n            },\n            \"clean_preference\": {\n              \"$ref\": \"#/definitions/translation_name\"\n            },\n            \"continuous_cleaning\": {\n              \"$ref\": \"#/definitions/translation_name\"\n            },\n            \"true_detect\": {\n              \"$ref\": \"#/definitions/translation_name\"\n            }\n          },\n          \"type\": \"object\"\n        },\n        \"vacuum\": {\n          \"additionalProperties\": false,\n          \"properties\": {\n            \"bot\": {\n              \"additionalProperties\": false,\n              \"properties\": {\n                \"state_attributes\": {\n                  \"additionalProperties\": false,\n                  \"properties\": {\n                    \"fan_speed\": {\n                      \"additionalProperties\": false,\n                      \"properties\": {\n                        \"state\": {\n                          \"additionalProperties\": false,\n                          \"properties\": {\n                            \"max\": {\n                              \"type\": \"string\"\n                            },\n                            \"max_plus\": {\n                              \"type\": \"string\"\n                            },\n                            \"normal\": {\n                              \"type\": \"string\"\n                            },\n                            \"quiet\": {\n                              \"type\": \"string\"\n                            }\n                          },\n                          \"type\": \"object\"\n                        }\n                      },\n                      \"type\": \"object\"\n                    },\n                    \"last_error\": {\n                      \"$ref\": \"#/definitions/translation_name\"\n                    },\n                    \"rooms\": {\n                      \"$ref\": \"#/definitions/translation_name\"\n                    }\n                  },\n                  \"type\": \"object\"\n                }\n              },\n              \"type\": \"object\"\n            },\n            \"carpet_auto_fan_speed_boost\": {\n              \"$ref\": \"#/definitions/translation_name\"\n            },\n            \"clean_preference\": {\n              \"$ref\": \"#/definitions/translation_name\"\n            },\n            \"continuous_cleaning\": {\n              \"$ref\": \"#/definitions/translation_name\"\n            },\n            \"true_detect\": {\n              \"$ref\": \"#/definitions/translation_name\"\n            }\n          },\n          \"type\": \"object\"\n        }\n      },\n      \"type\": \"object\"\n    },\n    \"issues\": {\n      \"additionalProperties\": false,\n      \"properties\": {\n        \"deprecated_integration_issue\": {\n          \"additionalProperties\": false,\n          \"properties\": {\n            \"description\": {\n              \"type\": \"string\"\n            },\n            \"title\": {\n              \"type\": \"string\"\n            }\n          },\n          \"type\": \"object\"\n        },\n        \"deprecated_service_refresh\": {\n          \"additionalProperties\": false,\n          \"properties\": {\n            \"fix_flow\": {\n              \"additionalProperties\": false,\n              \"properties\": {\n                \"step\": {\n                  \"additionalProperties\": false,\n                  \"properties\": {\n                    \"confirm\": {\n                      \"additionalProperties\": false,\n                      \"properties\": {\n                        \"description\": {\n                          \"type\": \"string\"\n                        },\n                        \"title\": {\n                          \"type\": \"string\"\n                        }\n                      },\n                      \"type\": \"object\"\n                    }\n                  },\n                  \"type\": \"object\"\n                }\n              },\n              \"type\": \"object\"\n            },\n            \"title\": {\n              \"type\": \"string\"\n            }\n          },\n          \"type\": \"object\"\n        }\n      },\n      \"type\": \"object\"\n    },\n    \"options\": {\n      \"additionalProperties\": false,\n      \"properties\": {\n        \"abort\": {\n          \"additionalProperties\": false,\n          \"properties\": {\n            \"cannot_connect\": {\n              \"type\": \"string\"\n            },\n            \"invalid_auth\": {\n              \"type\": \"string\"\n            },\n            \"no_supported_devices_found\": {\n              \"type\": \"string\"\n            },\n            \"unknown_get_devices\": {\n              \"type\": \"string\"\n            }\n          },\n          \"type\": \"object\"\n        },\n        \"error\": {\n          \"additionalProperties\": false,\n          \"properties\": {\n            \"select_robots\": {\n              \"type\": \"string\"\n            },\n            \"unknown\": {\n              \"type\": \"string\"\n            }\n          },\n          \"type\": \"object\"\n        },\n        \"step\": {\n          \"additionalProperties\": false,\n          \"properties\": {\n            \"init\": {\n              \"additionalProperties\": false,\n              \"properties\": {\n                \"data\": {\n                  \"additionalProperties\": false,\n                  \"properties\": {\n                    \"devices\": {\n                      \"type\": \"string\"\n                    }\n                  },\n                  \"type\": \"object\"\n                },\n                \"data_description\": {\n                  \"additionalProperties\": false,\n                  \"properties\": {\n                    \"devices\": {\n                      \"type\": \"string\"\n                    }\n                  },\n                  \"type\": \"object\"\n                }\n              },\n              \"type\": \"object\"\n            }\n          },\n          \"type\": \"object\"\n        }\n      },\n      \"type\": \"object\"\n    },\n    \"selector\": {\n      \"additionalProperties\": false,\n      \"properties\": {\n        \"refresh_category\": {\n          \"additionalProperties\": false,\n          \"properties\": {\n            \"options\": {\n              \"additionalProperties\": false,\n              \"properties\": {\n                \"battery\": {\n                  \"type\": \"string\"\n                },\n                \"clean_logs\": {\n                  \"type\": \"string\"\n                },\n                \"error\": {\n                  \"type\": \"string\"\n                },\n                \"fan_speed\": {\n                  \"type\": \"string\"\n                },\n                \"life_spans\": {\n                  \"type\": \"string\"\n                },\n                \"map\": {\n                  \"type\": \"string\"\n                },\n                \"rooms\": {\n                  \"type\": \"string\"\n                },\n                \"stats\": {\n                  \"type\": \"string\"\n                },\n                \"status\": {\n                  \"type\": \"string\"\n                },\n                \"water\": {\n                  \"type\": \"string\"\n                }\n              },\n              \"type\": \"object\"\n            }\n          },\n          \"type\": \"object\"\n        }\n      },\n      \"type\": \"object\"\n    },\n    \"services\": {\n      \"additionalProperties\": false,\n      \"properties\": {\n        \"refresh\": {\n          \"additionalProperties\": false,\n          \"properties\": {\n            \"description\": {\n              \"type\": \"string\"\n            },\n            \"fields\": {\n              \"additionalProperties\": false,\n              \"properties\": {\n                \"category\": {\n                  \"additionalProperties\": false,\n                  \"properties\": {\n                    \"description\": {\n                      \"type\": \"string\"\n                    },\n                    \"name\": {\n                      \"type\": \"string\"\n                    }\n                  },\n                  \"type\": \"object\"\n                }\n              },\n              \"type\": \"object\"\n            },\n            \"name\": {\n              \"type\": \"string\"\n            }\n          },\n          \"type\": \"object\"\n        }\n      },\n      \"type\": \"object\"\n    }\n  },\n  \"type\": \"object\"\n}\n"
  }
]