-
-
Notifications
You must be signed in to change notification settings - Fork 31.1k
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
Fix Mi Flora median calculation #16085
Fix Mi Flora median calculation #16085
Conversation
}) | ||
|
||
|
||
def setup_platform(hass, config, add_devices, discovery_info=None): | ||
@asyncio.coroutine |
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.
expected 2 blank lines, found 1
}) | ||
|
||
|
||
def setup_platform(hass, config, add_entities, discovery_info=None): | ||
@asyncio.coroutine | ||
def async_setup_platform(hass, config, async_add_entities, discovery_info=None): |
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.
line too long (80 > 79 characters)
}) | ||
|
||
|
||
def setup_platform(hass, config, add_entities, discovery_info=None): | ||
async def async_setup_platform(hass, config, async_add_entities, | ||
discovery_info=None): |
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.
continuation line under-indented for visual indent
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.
Good!
Please add a paragraph about the breaking change in the PR description for the release notes.
@MartinHjelmare done. |
* fixed median was based on 1.5 minute interval, not 1 hour * ignore median and set state from first value, when previous state was None * update before add, removed unused 'retries' and 'ble_timeout', check if platform ready * added missing blank line * fixed too long line * using modern python 3.5 features, changed comment to be less verbose * continuation line fix * removed DEFAULT_SCAN_INTERVAL in favor of existing SCAN_INTERVAL
Description:
miflora library caches values for 20 minutes.
miflora
HA component updates values each 30 seconds. Component gets 3 value updates, calculates median and sets state. During 20 minutes we get the same values from cache which makes median calculation totally useless - all values will be the same.cache_value
conf in favor of nativescan_interval
, which is now set to 1200 seconds and used for both update interval and cache timeout in the library.PlatformNotReady
to don't delay HA startupble_timeout
andretries
, they are not used in miflora library anymore and, actually, we don't need themPull request in home-assistant.github.io with documentation (if applicable): home-assistant/home-assistant.io/pull/6163
Breaking changes:
Removed
retries
andtimeout
config parameters, they were not used for several months. Replacedcache_value
config withscan_interval
to fix a bug in the PR.Checklist: