Skip to content

Commit

Permalink
Merge pull request #38 from anand-p-r/fix/lightning_strike_refresh
Browse files Browse the repository at this point in the history
fixed lightning update problem
  • Loading branch information
anand-p-r authored Jun 14, 2021
2 parents c9e12f5 + 4d964e3 commit a215429
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 3 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"domain": "fmi",
"version": "0.4.3",
"version": "0.4.4",
"name": "Finnish Meteorological Institute",
"documentation": "https://www.home-assistant.io/integrations/fmi/",
"requirements": [
Expand Down
6 changes: 4 additions & 2 deletions sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,9 +268,9 @@ def __init__(self, name, coordinator, sensor_type):
self._icon = "mdi:weather-lightning"
self.type = sensor_type
self._unit_of_measurement = SENSOR_LIGHTNING_TYPES[sensor_type][1]
self.lightning_data = coordinator.lightning_data
self._fmi = coordinator

self.lightning_data = coordinator.lightning_data

try:
self._fmi_name = coordinator.current.place
except:
Expand Down Expand Up @@ -342,6 +342,8 @@ def update(self):
"""Get the latest data from FMI and updates the states."""

self._fmi.async_request_refresh()
self.lightning_data = self._fmi.lightning_data

try:
self._state = self.lightning_data[0].location
except:
Expand Down
41 changes: 41 additions & 0 deletions translations/en-GB.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"config": {
"abort": {
"already_configured": "Location is already configured"
},
"error": {
"cannot_connect": "Failed to connect",
"unknown": "Unexpected error"
},
"step": {
"user": {
"data": {
"latitude": "Latitude",
"longitude": "Longitude",
"name": "Name"
},
"description": "FMI Configuration Parameters",
"title": "Finnish Meteorological Institute"
}
}
},
"options": {
"step": {
"user": {
"data": {
"max_precipitation": "Max Precipitation",
"max_relative_humidity": "Max Relative Humidity",
"max_temperature": "Max Temperature",
"max_wind_speed": "Max Wind Speed",
"min_precipitation": "Min Precipitation",
"min_relative_humidity": "Min Relative Humidity",
"min_temperature": "Min Temperature",
"min_wind_speed": "Min Wind Speed",
"offset": "Forecast Interval"
},
"description": "FMI Configuration Parameters",
"title": "FMI Options"
}
}
}
}

0 comments on commit a215429

Please sign in to comment.