Skip to content

Remove archived 17track packages from the entity registry#23049

Merged
MartinHjelmare merged 7 commits into
home-assistant:devfrom
bachya:17track-fix-2
Apr 19, 2019
Merged

Remove archived 17track packages from the entity registry#23049
MartinHjelmare merged 7 commits into
home-assistant:devfrom
bachya:17track-fix-2

Conversation

@bachya
Copy link
Copy Markdown
Contributor

@bachya bachya commented Apr 12, 2019

Description:

Following up on #23001, this PR further adjusts the 17track.net sensor so that packages are removed from the entity registry whenever they are archived.

Related issue (if applicable): fixes #22994

Pull request in home-assistant.io with documentation (if applicable): N/A

Example entry for configuration.yaml (if applicable):

sensor:
  - platform: seventeentrack 
    username: !secret 17track_username
    password: !secret 17track_password    

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.

@codecov

This comment has been minimized.

1 similar comment
@codecov

This comment has been minimized.

@Spirituss
Copy link
Copy Markdown

Hello,
I’ve also tested and it doesn’t work. I see the items in the registry.

Comment thread homeassistant/components/seventeentrack/sensor.py Outdated
@bachya bachya marked this pull request as ready for review April 15, 2019 18:10
Comment thread homeassistant/components/seventeentrack/sensor.py Outdated
Comment thread homeassistant/components/seventeentrack/sensor.py
Comment thread homeassistant/components/seventeentrack/sensor.py Outdated
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 19, 2019

Codecov Report

Merging #23049 into dev will decrease coverage by <.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##              dev   #23049      +/-   ##
==========================================
- Coverage   93.97%   93.97%   -0.01%     
==========================================
  Files         450      450              
  Lines       36878    36878              
==========================================
- Hits        34656    34655       -1     
- Misses       2222     2223       +1
Impacted Files Coverage Δ
homeassistant/components/uk_transport/sensor.py 93.43% <0%> (-0.73%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c8375be...3cf2ab5. Read the comment docs.

Copy link
Copy Markdown
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.

Looks good!

@MartinHjelmare MartinHjelmare merged commit 6a7bd19 into home-assistant:dev Apr 19, 2019
@MartinHjelmare
Copy link
Copy Markdown
Member

Since it's a fix, should we tag it for 0.92?

@bachya bachya deleted the 17track-fix-2 branch April 19, 2019 19:08
@balloob balloob mentioned this pull request May 14, 2019
@Spirituss
Copy link
Copy Markdown

With HA .93 receive the next errors:

ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.seventeentrack_package_xxx fails
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity.py", line 220, in async_update_ha_state
    await self.async_device_update()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity.py", line 375, in async_device_update
    await self.async_update()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/seventeentrack/sensor.py", line 218, in async_update
    await self._data.async_update()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/seventeentrack/sensor.py", line 309, in _async_update
    self._hass.async_create_task(reg.async_remove(entity_id))
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/core.py", line 291, in async_create_task
    task = self.loop.create_task(target)  # type: asyncio.tasks.Task
  File "/usr/lib/python3.5/asyncio/base_events.py", line 284, in create_task
    task = tasks.Task(coro, loop=self)
  File "/usr/lib/python3.5/asyncio/tasks.py", line 70, in __init__
    assert coroutines.iscoroutine(coro), repr(coro)
AssertionError: None

All previous tracking packages have been signed as Archived in 17tracks App before.

@MartinHjelmare
Copy link
Copy Markdown
Member

Please open an issue if you suspect a bug.

Merged PRs should not be used for bug reports. If you've found a bug it's ok to make a review with inline comments and link to an issue that reports the bug.

Thanks!

@home-assistant home-assistant locked as resolved and limited conversation to collaborators May 16, 2019
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.

Unavailable 17track sensors after successful delivery or archiving

4 participants