Add offline sensor read icon

Added new icon to indicate internal sensor reading when not connected to WiFi
dev
SQFMI 2023-04-28 14:59:41 -04:00
parent 342eb48a49
commit 9c50085077
6 changed files with 27 additions and 10 deletions

View File

@ -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);

View File

@ -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
};

View File

@ -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": [
{

View File

@ -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

View File

@ -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;

View File

@ -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)