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

Fixing the api_streams sensor #22200

Merged
merged 11 commits into from Mar 22, 2019

Conversation

@Swamp-Ig
Copy link
Contributor

commented Mar 20, 2019

Breaking Change:

api_streams sensor was designed to count connected front-end clients. However it depended on the implementation details of other components, therefore it has been broken since 0.80 release. This sensor is now removed.

The replacement sensor is now the websocket_api sensor, and does basically the same thing apart from the rename. It does not count connected clients for the deprecated api connections / component.

Description:

PR #22150 was going to remove the api_streams sensor, but I thought this could do with a rethink.

This mostly new sensor replaces the old sensor for counting websocket connections. I haven't implemented this for the old api component, but this is deprecated anyhow. It would be pretty easy to add if needed.

Checklist:

@Swamp-Ig Swamp-Ig requested a review from home-assistant/core as a code owner Mar 20, 2019

@ghost ghost assigned Swamp-Ig Mar 20, 2019

@ghost ghost added the in progress label Mar 20, 2019

@Swamp-Ig Swamp-Ig referenced this pull request Mar 20, 2019

Closed

Remove api streams sensor #22150

4 of 4 tasks complete
@balloob

This comment has been minimized.

Copy link
Member

commented Mar 20, 2019

If it's just limited to websocket API, we should make this sensor a part of the websocket API.

@Swamp-Ig

This comment has been minimized.

Copy link
Contributor Author

commented Mar 20, 2019

Downside of making the sensor a part of the websocket API is that you lose backwards compatibility with old configs. OFC it's really not being used a lot. I've noted that in the documents and put a breaking change notification on here.

@Swamp-Ig Swamp-Ig changed the title Websocket events and fixing the api_streams sensor. Fixing the api_streams sensor Mar 20, 2019

@Swamp-Ig Swamp-Ig referenced this pull request Mar 20, 2019

Merged

Renamed api_streams to websocket_api #8984

2 of 2 tasks complete

@Swamp-Ig Swamp-Ig requested a review from balloob Mar 20, 2019

@Swamp-Ig

This comment has been minimized.

Copy link
Contributor Author

commented Mar 20, 2019

@balloob All fixed as requested. Travis isn't completing because of other changes not made here. PR to fix those here #22207, it hasn't finished running yet..

@Swamp-Ig Swamp-Ig force-pushed the Swamp-Ig:websocket-events branch from 0745924 to b27fbf6 Mar 21, 2019

@Swamp-Ig Swamp-Ig requested review from balloob and awarecan Mar 21, 2019

@balloob balloob merged commit 1ddc65a into home-assistant:dev Mar 22, 2019

4 checks passed

Hound No violations found. Woof!
cla-bot Everyone involved has signed the CLA
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage decreased (-0.008%) to 93.677%
Details

@ghost ghost removed the in progress label Mar 22, 2019

entity = APICount()

# pylint: disable=protected-access
hass.helpers.dispatcher.async_dispatcher_connect(

This comment has been minimized.

Copy link
@MartinHjelmare

MartinHjelmare Mar 22, 2019

Member

This should be done from inside the entity in async_added_to_hass.

@Swamp-Ig Swamp-Ig deleted the Swamp-Ig:websocket-events branch Mar 23, 2019

mxworm added a commit to mxworm/home-assistant that referenced this pull request Mar 27, 2019

Merge branch 'dev' into current
* dev: (99 commits)
  show which component is causing translation errors (home-assistant#22340)
  fix where PLATFORM_SCHEMA gets pulled from (home-assistant#22334)
  Consolidate more platforms (home-assistant#22308)
  Update file header (home-assistant#22318)
  Remove occupancy as it is not available in API (home-assistant#22320)
  Google Assistant: Add camera stream trait (home-assistant#22278)
  Add Freebox switch platform (home-assistant#21710)
  Add homematicip cloud connection quality related attributes (home-assistant#21990)
  Update abbreviation (home-assistant#22317)
  Upgrade py-cpuinfo to 5.0.0 (home-assistant#22287)
  Upgrade pylast to 3.1.0 (home-assistant#22302)
  Fix for embedded MQTT server configuration (home-assistant#22305)
  Switch from using Google Maps API for elevation to Open Elevation API (home-assistant#22306)
  Update srpenergy library (home-assistant#22307)
  Sort code owners alphabetically (home-assistant#22304)
  Update trait to support auto without ranges. (home-assistant#21847)
  Fix Prometheus casting issues (home-assistant#22282)
  Add sort by config and tests for Reddit integration (home-assistant#22081)
  Fix progress for Plex media_players (home-assistant#22224)
  Fixing the api_streams sensor (home-assistant#22200)
  ...

@balloob balloob removed the new-platform label Mar 28, 2019

@balloob balloob referenced this pull request Apr 3, 2019

Merged

0.91.0 #22688

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.