Skip to content

Commit

Permalink
Fix issue in nabweather where no visual information did not remove a …
Browse files Browse the repository at this point in the history
…rain alert

Fix #230
  • Loading branch information
Olivier Mével committed May 16, 2021
1 parent 3b24acd commit e2fe6c7
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions nabweatherd/nabweatherd.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,8 @@ def get_animation(self, info_data):
return

logging.debug(f"get_animation :{info_data['weather_animation_type']}")
#

# Rain
if (info_data["weather_animation_type"] == "weather_and_rain") or (
info_data["weather_animation_type"] == "rain_only"
):
Expand All @@ -474,6 +475,7 @@ def get_animation(self, info_data):
packet = '{"type":"info",' '"info_id":"nabweatherd_rain"}\r\n'
self.writer.write(packet.encode("utf8"))

# Weather
if (info_data["weather_animation_type"] == "weather_and_rain") or (
(info_data["weather_animation_type"] == "weather_only")
):
Expand All @@ -487,8 +489,12 @@ def get_animation(self, info_data):
info_data["today_forecast_weather_class"]
]
return info_animation
else:
logging.debug("get_animation : return none")

if info_data["weather_animation_type"] == "nothing":
# Return mais avant on supprime l'animation rain
packet = '{"type":"info",' '"info_id":"nabweatherd_rain"}\r\n'
self.writer.write(packet.encode("utf8"))
logging.debug("get_animation : no visual information")
return None

async def perform_additional(self, expiration, type, info_data, config_t):
Expand Down

0 comments on commit e2fe6c7

Please sign in to comment.