helto4real / custom_component_myfitnesspal

Custom component in Home Assistant for getting fitness datat from MyFitnessPal
MIT License
13 stars 13 forks source link

Add support for KJ and replace deprecated function #21

Closed actuallydamo closed 2 years ago

actuallydamo commented 2 years ago

In Home Assistant 2021.4.0 extra_state_attributes was introduced as a replacement for device_state_attributes.

This was causing the below warning to be logged: Entity sensor.myfitnesspal [...] implements device_state_attributes. Please report it to the custom component author.

This change replaces the function with the new one.

When attempting to setup an account with kilojoules set for energy, a ZeroDivisionError would be generated.

This change adds support for accounts with kilojoules set for energy. Additionally this change provides both energy units for all attributes.

Have also fixed some spelling and grammar issues in the readme.