Skip to content

Restore unit_of_measurement from entity registry#30780

Merged
balloob merged 2 commits into
home-assistant:devfrom
Jc2k:more_capability_attributes
Jan 15, 2020
Merged

Restore unit_of_measurement from entity registry#30780
balloob merged 2 commits into
home-assistant:devfrom
Jc2k:more_capability_attributes

Conversation

@Jc2k
Copy link
Copy Markdown
Member

@Jc2k Jc2k commented Jan 15, 2020

Description:

As discussed in #30775, unit_of_measurement was not stored in (or restored from) the entity registry. This PR implements it the same was as device_class was handled.

This allows HomeKit to refer to unit_of_measurement when configuring itself, hopefully removing one more case where auto_start is needed.

CC @balloob

Related issue (if applicable): fixes #30775

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.
  • I have followed the [development checklist][dev-checklist]

@yuvalabou
Copy link
Copy Markdown
Contributor

does this mean that all entities (lets say sensors) will have configurable "unit of measurment"?

@Jc2k
Copy link
Copy Markdown
Member Author

Jc2k commented Jan 15, 2020

No - this is an extension of the work started here, here and here. The value is populated from the states, its just that it persists over a reboot now.

This allows integrations that operate on other integrations (like Alexa or HomeKit) to know that there is a Temperature Sensor and its unit type is "C" even if that temperature sensor was offline when HA started.

In the case of HomeKit, this will hopefully mean the end of the auto_start: False hackery - but i don't know if we are quite there yet for all entities.

@balloob balloob added this to the 0.104.0 milestone Jan 15, 2020
@balloob balloob merged commit de26108 into home-assistant:dev Jan 15, 2020
raman325 added a commit to raman325/home-assistant that referenced this pull request Jan 15, 2020
* upstream/dev: (82 commits)
  Add support for vacuums to Alexa. (home-assistant#30764)
  Refactor Ring data handling (home-assistant#30777)
  Restore unit_of_measurement from entity registry (home-assistant#30780)
  Update pyubee to 0.8 (home-assistant#30785)
  Update emulated_roku to 0.1.9 (home-assistant#30791)
  Add Config Flow support, Device Registry support, available property to vizio component (home-assistant#30653)
  Allow input_* and timer component setup without config (home-assistant#30772)
  Search: Add search to default config and don't resolve area (home-assistant#30762)
  [ci skip] Translation update
  Use storage based collections for Timer platform (home-assistant#30765)
  Upgrade youtube_dl to version 2020.01.15 (home-assistant#30767)
  Whitelist Frenck for release
  Hass.io allow to reset password with CLI (home-assistant#30755)
  Revert home-assistant#29701 (home-assistant#30766)
  Add Safe Mode (home-assistant#30723)
  Update Ring to 0.6.0 (home-assistant#30748)
  Add support for the voltage sensor on the greeneye GEM (home-assistant#30484)
  Fix supported_features in MQTT fan (home-assistant#28680)
  Fix small typo in alarmdotcom component (home-assistant#30758)
  bump aiokef to 0.2.5 which uses locks (home-assistant#30753)
  ...
frenck pushed a commit that referenced this pull request Jan 15, 2020
* Restore unit_of_measurement from entity registry

* Lint fix
@lock lock Bot locked and limited conversation to collaborators Jan 16, 2020
@Jc2k Jc2k deleted the more_capability_attributes branch February 25, 2020 13:20
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.

Homekit accesories not show automatically on auto_start

5 participants