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

Add time platform #81949

Merged
merged 20 commits into from
Apr 30, 2023
Merged

Add time platform #81949

merged 20 commits into from
Apr 30, 2023

Conversation

raman325
Copy link
Contributor

@raman325 raman325 commented Nov 11, 2022

Proposed change

Adds a new time platform. See home-assistant/architecture#811 for summary. Related to #81943 and #81948

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)
  • Code quality improvements to existing code or addition of tests

Additional information

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.

To help with the load of incoming pull requests:

@home-assistant
Copy link

Hey there @home-assistant/core, mind taking a look at this pull request as it has been labeled with an integration (demo) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of demo can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Change the title of the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign demo Removes the current integration label and assignees on the issue, add the integration domain after the command.

This was referenced Nov 11, 2022
Copy link
Member

@rytilahti rytilahti left a comment

Choose a reason for hiding this comment

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

Looks good besides some very nitpicky issues, I can't wait to see this platform to be added so thanks for working on it! 🥇

homeassistant/components/demo/time.py Outdated Show resolved Hide resolved
homeassistant/components/time/services.yaml Outdated Show resolved Hide resolved
homeassistant/components/demo/time.py Outdated Show resolved Hide resolved
homeassistant/components/demo/time.py Outdated Show resolved Hide resolved
homeassistant/components/demo/time.py Outdated Show resolved Hide resolved
tests/components/time/test_init.py Outdated Show resolved Hide resolved
@github-actions
Copy link

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.
Thank you for your contributions.

@github-actions github-actions bot added the stale label Feb 19, 2023
@frenck
Copy link
Member

frenck commented Feb 19, 2023

Dear bot, this is definitely not stale (it could use a rebase though).

@github-actions github-actions bot removed the stale label Feb 19, 2023
* dev: (1718 commits)
  Reolink prevent ONVIF push being lost due to ConnectionResetError (home-assistant#91070)
  Ensure recorder always attempts clean shutdown if recorder thread raises (home-assistant#91261)
  Use fast path for track_time_change that fires every second (home-assistant#91432)
  Improve performance of tracking time changes (home-assistant#91433)
  Add ability to shutdown a Debouncer (home-assistant#91439)
  Bump yalexs to 1.3.0 (home-assistant#91431)
  History API entity_id validation (home-assistant#90067)
  Add slots to dataclasses in default_config (home-assistant#91410)
  Delete obsolete lines and add some missing type hints in OpenTherm Gateway integration (home-assistant#90530)
  Remove duplicate webhook test (home-assistant#91420)
  Bump accuweather to version 0.5.1 (home-assistant#91412)
  Add webhook trigger allowed_methods/local_only options (home-assistant#66494)
  Save Thread dataset store when changing preferred dataset (home-assistant#91411)
  Allow GET in webhook triggers (home-assistant#56446)
  Rename Particulate matter sensors to PM (home-assistant#91384)
  Do not allow mqtt lights to set brightness to zero (home-assistant#91296)
  Bump onvif-zeep-async to 1.2.5 (home-assistant#91399)
  Support Sonos announcements using websockets (home-assistant#91145)
  Fix lingering timer in EntityRegistryDisabledHandler (home-assistant#91376)
  Fix lingering timers in analytics (home-assistant#91363)
  ...
Copy link
Member

@frenck frenck left a comment

Choose a reason for hiding this comment

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

After some discussion, we decided we should add the attributes.

This is mostly, because they are "duplicates" of the existing state. I understand they are primarily a copy over from the input helpers, which makes sense, but they still, cause duplicate data to be kept in the state machine.

For now, let's remove them. If there is a bigger need, we can always introduce them later.

../Frenck

homeassistant/components/time/__init__.py Outdated Show resolved Hide resolved
homeassistant/components/time/__init__.py Outdated Show resolved Hide resolved
homeassistant/components/time/recorder.py Outdated Show resolved Hide resolved
homeassistant/components/time/strings.json Outdated Show resolved Hide resolved
tests/components/time/test_init.py Outdated Show resolved Hide resolved
tests/components/time/test_init.py Outdated Show resolved Hide resolved
tests/components/time/test_init.py Outdated Show resolved Hide resolved
tests/components/time/test_recorder.py Outdated Show resolved Hide resolved
homeassistant/components/time/const.py Outdated Show resolved Hide resolved
@home-assistant home-assistant bot marked this pull request as draft April 22, 2023 11:07
@home-assistant
Copy link

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

Learn more about our pull request process.

@frenck frenck marked this pull request as ready for review April 30, 2023 20:29
@home-assistant home-assistant bot requested a review from frenck April 30, 2023 20:29
@frenck
Copy link
Member

frenck commented Apr 30, 2023

Marking ready for review, as 2023.6 is now in dev.

Copy link
Member

@frenck frenck left a comment

Choose a reason for hiding this comment

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

Looks good to me, thanks @raman325 👍

../Frenck

@frenck frenck merged commit c0d0c89 into home-assistant:dev Apr 30, 2023
@raman325 raman325 deleted the time branch April 30, 2023 20:48
@epenet
Copy link
Contributor

epenet commented May 1, 2023

Should it be added to

base_platforms: &base_platforms
?

@github-actions github-actions bot locked and limited conversation to collaborators May 2, 2023
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