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

Remove device class timestamp from device condition and trigger #48431

Merged
merged 5 commits into from
Apr 1, 2021

Conversation

MartinHjelmare
Copy link
Member

@MartinHjelmare MartinHjelmare commented Mar 28, 2021

Breaking change

  • Remove unit of measurement from Garmin connect and system monitor timestamp sensors. It used to be set to empty string. Users should adjust automations and scripts that rely on unit of measurement for these sensors.

Proposed change

  • Timestamp device class sensors don't have a unit of measurement. Device conditions and triggers will therefore not work with this sensor with our current way of creating device conditions and triggers, since they rely on a unit of measurement.
  • Remove the timestamp device class from device conditions and triggers.
  • Clean up a couple of integrations that had set a unit for device class timestamp incorrectly.
  • The only remaining integration is subaru which currently also calculates state incorrectly for timestamp. This should be fixed separately.

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

Example entry for configuration.yaml:

# Example configuration.yaml

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:
  • Link to documentation pull request:

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

@MartinHjelmare
Copy link
Member Author

@bramkragten are there any changes needed for the frontend?

@probot-home-assistant
Copy link

Hey there @cyberjunky, mind taking a look at this pull request as its been labeled with an integration (garmin_connect) you are listed as a codeowner for? Thanks!
(message by CodeOwnersMention)

@coryshack
Copy link

coryshack commented Mar 28, 2021 via email

@coryshack
Copy link

coryshack commented Mar 28, 2021 via email

@@ -47,7 +48,7 @@
],
"ipv4_address": ["IPv4 address", "", "mdi:server-network", None, True],
"ipv6_address": ["IPv6 address", "", "mdi:server-network", None, True],
"last_boot": ["Last boot", "", "mdi:clock", "timestamp", False],
"last_boot": ["Last boot", None, "mdi:clock", DEVICE_CLASS_TIMESTAMP, False],
Copy link
Member Author

Choose a reason for hiding this comment

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

Note that we don't change the icon, even though it should not be set when device class is set. I want to avoid a breaking change in this PR. We can fix this separately.

Copy link
Member Author

Choose a reason for hiding this comment

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

Although technically setting the unit to None is also a breaking change.

Copy link
Member

@frenck frenck Mar 28, 2021

Choose a reason for hiding this comment

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

Lets add a small note so it ends up in the release notes. Better to mention it, even if it is small. (which you did 👍 )

@bramkragten
Copy link
Member

@bramkragten are there any changes needed for the frontend?

I don't think so

@MartinHjelmare MartinHjelmare merged commit fdbef90 into dev Apr 1, 2021
@MartinHjelmare MartinHjelmare deleted the remove-unit-device-class-timestamp branch April 1, 2021 13:05
@github-actions github-actions bot locked and limited conversation to collaborators Apr 2, 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.

6 participants