Skip to content

Commit

Permalink
Merge branch 'release/1.2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
syssi committed Oct 24, 2024
2 parents df5305e + cc862a5 commit a23be95
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/ambv/black
rev: stable
rev: 24.10.0
hooks:
- id: black
language_version: python3
2 changes: 1 addition & 1 deletion custom_components/nextbike/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
"iot_class": "local_polling",
"issue_tracker": "https://github.com/syssi/nextbike/issues",
"requirements": [],
"version": "1.1.1"
"version": "1.2.0"
}
5 changes: 3 additions & 2 deletions custom_components/nextbike/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
For more details about this platform, please refer to the documentation at
https://github.com/syssi/nextbike
"""

import asyncio
import logging
from datetime import timedelta
Expand Down Expand Up @@ -138,15 +139,15 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
longitude = config.get(CONF_LONGITUDE, hass.config.longitude)
radius = config.get(CONF_RADIUS)
name = config.get(CONF_NAME)
if hass.config.units is METRIC_SYSTEM:
if hass.config.units is not METRIC_SYSTEM:
radius = DistanceConverter.convert(
radius, UnitOfLength.FEET, UnitOfLength.METERS
)

if city_id not in hass.data[PLATFORM]:
city = NextbikeCity(hass, city_id)
hass.data[PLATFORM][city_id] = city
hass.async_add_job(city.async_refresh)
hass.async_add_executor_job(city.async_refresh)
async_track_time_interval(hass, city.async_refresh, SCAN_INTERVAL)
else:
city = hass.data[PLATFORM][city_id]
Expand Down

0 comments on commit a23be95

Please sign in to comment.