Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Rework octoprint #58040

Merged
merged 10 commits into from
Oct 22, 2021
Merged

Rework octoprint #58040

merged 10 commits into from
Oct 22, 2021

Conversation

rfleming71
Copy link
Contributor

@rfleming71 rfleming71 commented Oct 19, 2021

Breaking change

The OctoPrint integration migrated to configuration via the UI. Configuring OctoPrint via YAML configuration has been deprecated and will be removed in a future Home Assistant release.

Your existing YAML configuration is automatically imported on upgrade to this release; and thus can be safely removed from your YAML configuration after upgrading.

Sensors removed:

  • sensor._time_remaining
  • sensor._time_elapsed

Sensors added:

  • sensor.octoprint_start_time
  • sensor.octoprint_estimated_finish_time

Previously entities added would be prefixed by the printer name, i.e. if the printer was ender 5, the sensors would be sensor.ender_5_bed_temp0. After this change they will be sensor.octoprint_bed_temp0 and can be renamed.

Proposed change

Updating octoprint integration to use library to handle the API and adding a config_flow.

Previous PRs for the initial two commits:
#46432
#46611

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)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

First two commits were reviewed before merge into rework-octoprint.
Following commits are to resolve issues after the rebase.

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • The code has been formatted using Black (black --fast 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:

  • 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.

The integration reached or maintains the following Integration Quality Scale:

  • No score or internal
  • 🥈 Silver
  • 🥇 Gold
  • 🏆 Platinum

To help with the load of incoming pull requests:

@bachya
Copy link
Contributor

bachya commented Oct 19, 2021

For a PR this size, we should probably have more of a description than:

PR merging the rework octoprint branch to dev

@MartinHjelmare
Copy link
Member

I've rebased the rework-octoprint branch on latest dev just now.

homeassistant/components/octoprint/__init__.py Outdated Show resolved Hide resolved
homeassistant/components/octoprint/__init__.py Outdated Show resolved Hide resolved
homeassistant/components/octoprint/__init__.py Outdated Show resolved Hide resolved
homeassistant/components/octoprint/binary_sensor.py Outdated Show resolved Hide resolved
homeassistant/components/octoprint/sensor.py Outdated Show resolved Hide resolved
homeassistant/components/octoprint/sensor.py Outdated Show resolved Hide resolved
homeassistant/components/octoprint/sensor.py Outdated Show resolved Hide resolved
homeassistant/components/octoprint/sensor.py Outdated Show resolved Hide resolved
homeassistant/components/octoprint/sensor.py Outdated Show resolved Hide resolved
@MartinHjelmare MartinHjelmare self-assigned this Oct 20, 2021
@MartinHjelmare
Copy link
Member

Please fix the failing tests and add the missing config flow tests in a new PR targeting rework-octoprint branch.

@MartinHjelmare MartinHjelmare removed their assignment Oct 20, 2021
@rfleming71 rfleming71 mentioned this pull request Oct 21, 2021
22 tasks
rfleming71 and others added 8 commits October 21, 2021 22:35
Co-authored-by: Martin Hjelmare <[email protected]>
* Bump library version to 1.6 to fix header usages

* Add already configured tests for ssdp, zeroconf, and user

* Set ssl value correctly on the form when an error occurs

* Test fixes
Copy link
Member

@MartinHjelmare MartinHjelmare left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great!

…58190)

* Mark printer entities unavailable when printer is offline

* Fixing code review comments

* Fix printer offline status and unit test typing
@MartinHjelmare MartinHjelmare merged commit c84fee7 into dev Oct 22, 2021
@MartinHjelmare MartinHjelmare deleted the rework-octoprint branch October 22, 2021 13:25
@cdce8p cdce8p mentioned this pull request Oct 22, 2021
22 tasks
@github-actions github-actions bot locked and limited conversation to collaborators Oct 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants