diff --git a/homeassistant/components/airvisual/__init__.py b/homeassistant/components/airvisual/__init__.py index 6254d533a0f..7450ff2afcf 100644 --- a/homeassistant/components/airvisual/__init__.py +++ b/homeassistant/components/airvisual/__init__.py @@ -80,9 +80,9 @@ def async_get_cloud_api_update_interval(hass, api_key, num_consumers): This will shift based on the number of active consumers, thus keeping the user under the monthly API limit. """ - # Assuming 10,000 calls per month and a "smallest possible month" of 28 days; note + # Assuming 10,000 calls per month and a "largest possible month" of 31 days; note # that we give a buffer of 1500 API calls for any drift, restarts, etc.: - minutes_between_api_calls = ceil(1 / (8500 / 28 / 24 / 60 / num_consumers)) + minutes_between_api_calls = ceil(num_consumers * 31 * 24 * 60 / 8500) LOGGER.debug( "Leveling API key usage (%s): %s consumers, %s minutes between updates",