-
-
Notifications
You must be signed in to change notification settings - Fork 30
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
Migrate to native unit of measurement #550
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! However, should you not make changes here as well:
ha-tahoma/custom_components/tahoma/sensor.py
Lines 338 to 349 in d46a4af
def state(self): | |
"""Return the value of the sensor.""" | |
state = self.device.states.get(self.entity_description.key) | |
if not state: | |
return None | |
# Transform the value with a lambda function | |
if hasattr(self.entity_description, "value"): | |
return self.entity_description.value(state.value) | |
return state.value |
Good question. I will check. |
c9fdb5c
to
982bd91
Compare
@iMicknl Ready to be merged. |
I've upgraded to 2.7.1 but I still get the error: Logger: homeassistant.components.sensor custom_components.tahoma.sensor is setting 'unit_of_measurement' on an instance of SensorEntityDescription, this is not valid and will be unsupported from Home Assistant 2021.11. Please report it to the custom component author. |
Fix #547
See https://developers.home-assistant.io/docs/core/entity/sensor