@require(internet)<EOL><INDENT>def get_forecast(self):<DEDENT>
no_data = ('<STR_LIT>', '<STR_LIT>')<EOL>if self.forecast:<EOL><INDENT>query_url = STATION_QUERY_URL % (self.api_key,<EOL>'<STR_LIT>',<EOL>self.station_id)<EOL>try:<EOL><INDENT>response = self.api_request(query_url)['<STR_LIT>']<EOL>response = response['<STR_LIT>']['<STR_LIT>'][<NUM_LIT:0>]<EOL><DEDENT>except (KeyError, IndexError, TypeError):<EOL><INDENT>self.logger.error(<EOL>'<STR_LIT>', self.station_id)<EOL>self.data['<STR_LIT>'] = self.update_error<EOL>return no_data<EOL><DEDENT>unit = '<STR_LIT>' if self.units == '<STR_LIT>' else '<STR_LIT>'<EOL>low_temp = response.get('<STR_LIT>', {}).get(unit, '<STR_LIT>')<EOL>high_temp = response.get('<STR_LIT>', {}).get(unit, '<STR_LIT>')<EOL>return low_temp, high_temp<EOL><DEDENT>else:<EOL><INDENT>return no_data<EOL><DEDENT>
If configured to do so, make an API request to retrieve the forecast
data for the configured/queried weather station, and return the low and
high temperatures. Otherwise, return two empty strings.