mirror of https://github.com/sqfmi/Watchy.git
Add offline sensor read icon
Added new icon to indicate internal sensor reading when not connected to WiFidev
parent
342eb48a49
commit
9c50085077
|
@ -142,6 +142,8 @@ void Watchy7SEG::drawWeather(){
|
|||
weatherIcon = drizzle;
|
||||
}else if(weatherConditionCode >=200){//Thunderstorm
|
||||
weatherIcon = thunderstorm;
|
||||
}else if(weatherConditionCode == -1){//chip
|
||||
weatherIcon = chip;
|
||||
}else
|
||||
return;
|
||||
display.drawBitmap(145, 158, weatherIcon, WEATHER_ICON_WIDTH, WEATHER_ICON_HEIGHT, DARKMODE ? GxEPD_WHITE : GxEPD_BLACK);
|
||||
|
|
|
@ -174,3 +174,19 @@ const unsigned char wifioff [] PROGMEM = {
|
|||
0x01, 0xff, 0xc0, 0x00, 0x07, 0xe1, 0xc0, 0x00, 0x0f, 0xc0, 0x80, 0x00, 0x1f, 0x0c, 0x00, 0x00,
|
||||
0x3c, 0x1e, 0x00, 0x00, 0xf8, 0x0c, 0x00, 0x00
|
||||
};
|
||||
// 'chip', 32x32px
|
||||
const unsigned char chip [] PROGMEM = {
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x48, 0x00, 0x00, 0x00, 0x00,
|
||||
0x12, 0x48, 0x00, 0x00, 0x00, 0x00, 0x12, 0x48, 0x00, 0x00, 0x00, 0x00, 0x12, 0x48, 0x00, 0x00,
|
||||
0x00, 0x00, 0x1f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x20, 0x01, 0x00, 0x00, 0x00, 0x00, 0x40, 0x01,
|
||||
0x00, 0x00, 0x00, 0x0f, 0x87, 0xf9, 0xf0, 0x00, 0x00, 0x00, 0x88, 0x09, 0x00, 0x00, 0x00, 0x00,
|
||||
0x90, 0x09, 0x00, 0x00, 0x00, 0x0f, 0x90, 0x09, 0xf0, 0x00, 0x00, 0x00, 0x90, 0x09, 0x00, 0x00,
|
||||
0x00, 0x00, 0x90, 0x09, 0x00, 0x00, 0x00, 0x0f, 0x90, 0x09, 0xf0, 0x00, 0x00, 0x00, 0x90, 0x09,
|
||||
0x00, 0x00, 0x00, 0x00, 0x90, 0x09, 0x00, 0x00, 0x00, 0x0f, 0x9f, 0xf9, 0xf0, 0x00, 0x00, 0x00,
|
||||
0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00,
|
||||
0x00, 0x00, 0x12, 0x48, 0x00, 0x00, 0x00, 0x00, 0x12, 0x48, 0x00, 0x00, 0x00, 0x00, 0x12, 0x48,
|
||||
0x00, 0x00, 0x00, 0x00, 0x12, 0x48, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
};
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "Watchy",
|
||||
"version": "1.4.7",
|
||||
"version": "1.4.8",
|
||||
"description": "Watchy - An Open Source E-Paper Watch by SQFMI",
|
||||
"authors": [
|
||||
{
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
name=Watchy
|
||||
version=1.4.7
|
||||
version=1.4.8
|
||||
author=SQFMI
|
||||
maintainer=SQFMI
|
||||
sentence=Watchy - An Open Source E-Paper Watch by SQFMI
|
||||
|
|
|
@ -662,19 +662,18 @@ weatherData Watchy::getWeatherData(String cityID, String units, String lang,
|
|||
gmtOffset = int(responseObject["timezone"]);
|
||||
syncNTP(gmtOffset);
|
||||
} else {
|
||||
// http error
|
||||
// http error, use internal temperature sensor
|
||||
currentWeather.temperature = currentWeather.isMetric ? (uint8_t)sensor.readTemperature() : (uint8_t)sensor.readTemperatureF();
|
||||
currentWeather.weatherConditionCode = -1;
|
||||
currentWeather.external = false;
|
||||
}
|
||||
http.end();
|
||||
// turn off radios
|
||||
WiFi.mode(WIFI_OFF);
|
||||
btStop();
|
||||
} else { // No WiFi, use internal temperature sensor
|
||||
uint8_t temperature = sensor.readTemperature(); // celsius
|
||||
if (!currentWeather.isMetric) {
|
||||
temperature = temperature * 9. / 5. + 32.; // fahrenheit
|
||||
}
|
||||
currentWeather.temperature = temperature;
|
||||
currentWeather.weatherConditionCode = 800;
|
||||
currentWeather.temperature = currentWeather.isMetric ? (uint8_t)sensor.readTemperature() : (uint8_t)sensor.readTemperatureF();
|
||||
currentWeather.weatherConditionCode = -1;
|
||||
currentWeather.external = false;
|
||||
}
|
||||
weatherIntervalCounter = 0;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#define CONFIG_H
|
||||
|
||||
// Versioning
|
||||
#define WATCHY_LIB_VER "1.4.7"
|
||||
#define WATCHY_LIB_VER "1.4.8"
|
||||
|
||||
//pins
|
||||
#if !defined(ARDUINO_WATCHY_V10) && !defined(ARDUINO_WATCHY_V15) && !defined(ARDUINO_WATCHY_V20)
|
||||
|
|
Loading…
Reference in New Issue