core icon indicating copy to clipboard operation
core copied to clipboard

Reach platinum level in Minecraft Server

Open elmurato opened this issue 1 year ago • 4 comments

Proposed change

SSIA

No score

Silver 🥈

  • ✅ Satisfying all No score level requirements.
  • ✅ Connection/configuration is handled via a component.
  • ✅ Set an appropriate SCAN_INTERVAL (if a polling integration) ➡️ 1 minute
  • ➖ Raise PlatformNotReady if unable to connect during platform setup (if appropriate) ➡️ ConfigEntryNotReady supported via DataUpdateCoordinator instead, all data are fetched centrally
  • ➖ Handles expiration of auth credentials. Refresh if possible or print correct error and fail setup. If based on a config entry, should trigger a new config entry flow to re-authorize. (docs) ➡️ No authentication required
  • ✅ Handles internet unavailable. Log a warning once when unavailable, log once when reconnected. ➡️ DataUpdateCoordinator
  • ✅ Handles device/service unavailable. Log a warning once when unavailable, log once when reconnected. ➡️ DataUpdateCoordinator
  • ➖ Operations like service calls and entity methods (e.g. Set HVAC Mode) have proper exception handling. Raise ValueError on invalid user input and raise HomeAssistantError for other failures such as a problem communicating with a device. ➡️ No services are supported
  • ✅ Set available property to False if appropriate (docs)
  • ✅ Entities have unique ID (if available) (docs)

Gold 🥇

  • ✅ Satisfying all Silver level requirements.
  • Configurable via config entries.
    • ✅ Don't allow configuring already configured device/service (example: no 2 entries for same hub) ➡️ As there is no unique information available from the library/server during config flow the only possibility is to check if the entered server address is already used in one of the existing config entries: PR #116852
    • ➖ Discoverable (if available) ➡️ Didn't find way for auto discovery.
    • ➖ Set unique ID in config flow (if available) ➡️ No unique information available from library/server
    • ✅ Raise ConfigEntryNotReady if unable to connect during entry setup (if appropriate) ➡️ DataUpdateCoordinator
  • ✅ Entities have device info (if available) (docs)
  • Tests
    • ✅ Full test coverage for the config flow
    • ✅ Above average test coverage for all integration modules ➡️ Test coverage is 100%
    • ✅ Tests for fetching data from the integration and controlling it (docs)
  • ✅ Has a code owner (docs)
  • ✅ Entities only subscribe to updates inside async_added_to_hass and unsubscribe inside async_will_remove_from_hass (docs) ➡️ DataUpdateCoordinator
  • ✅ Entities have correct device classes where appropriate (docs)
  • ✅ Supports entities being disabled and leverages Entity.entity_registry_enabled_default to disable less popular entities (docs)
  • ➖ If the device/service API can remove entities, the integration should make sure to clean up the entity and device registry. ➡️ Entities cannot be removed via device/service API
  • ✅ When communicating with a device or service, the integration implements the diagnostics platform which redacts sensitive information.

Platinum 🏆

  • ✅ Satisfying all Gold level requirements.
  • ✅ Set appropriate PARALLEL_UPDATES constant (docs) ➡️ Default value is probably fine for this integration
  • ✅ Support config entry unloading (called when config entry is removed)
  • ✅ Integration + dependency are async (docs) ➡️ PR #105403; lookup API of the library for Bedrock Edition servers is not async, but is non-blocking and therefor OK to be called (see FAQ of mcstatus)
  • ➖ Uses aiohttp or httpx and allows passing in websession (if making HTTP requests) ➡️ No HTTP requests
  • Handles expired credentials (if appropriate) ➡️ No authentication/credentials required

Type of change

  • [ ] Dependency upgrade
  • [ ] Bugfix (non-breaking change which fixes an issue)
  • [ ] New integration (thank you!)
  • [ ] New feature (which adds functionality to an existing integration)
  • [ ] Deprecation (breaking change to happen in the future)
  • [ ] Breaking change (fix/feature causing existing functionality to break)
  • [x] Code quality improvements to existing code or addition of tests

Additional information

  • This PR fixes or closes issue: n.a.
  • This PR is related to issue: n.a.
  • Link to documentation pull request: n.a. (doc update w.r.t quality scale handled automatically)

Checklist

  • [x] The code change is tested and works locally.
  • [x] Local tests pass. Your PR cannot be merged unless tests pass
  • [x] There is no commented out code in this PR.
  • [x] I have followed the development checklist
  • [x] I have followed the perfect PR recommendations
  • [x] The code has been formatted using Ruff (ruff format homeassistant tests)
  • [ ] Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • [x] The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • [ ] New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • [ ] For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.
  • [ ] Untested files have been added to .coveragerc.

To help with the load of incoming pull requests:

elmurato avatar Dec 10 '23 09:12 elmurato

There hasn't been any activity on this pull request recently. This pull request has been automatically marked as stale because of that and will be closed if no further activity occurs within 7 days. If you are the author of this PR, please leave a comment if you want to keep it open. Also, please rebase your PR onto the latest dev branch to ensure that it's up to date with the latest changes. Thank you for your contribution!

github-actions[bot] avatar May 02 '24 16:05 github-actions[bot]

Waiting for review

elmurato avatar May 02 '24 16:05 elmurato

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks :+1:

Learn more about our pull request process.

home-assistant[bot] avatar May 02 '24 20:05 home-assistant[bot]

  • ➖ Don't allow configuring already configured device/service (example: no 2 entries for same hub) ➡️ Not really possible as there is no unique information available from the library/server during config flow. Only possibility would be to check if the entered server address is already used in one of the existing config entries.

that's the way to go here - check if same server is already configured

PR #116852 Keeping this PR in draft state until the new PR is merged.

EDIT: New PR is merged now.

elmurato avatar May 05 '24 12:05 elmurato