mirror of https://github.com/sqfmi/Watchy.git
Compare commits
2 Commits
342eb48a49
...
ffc7de15b8
Author | SHA1 | Date |
---|---|---|
SQFMI | ffc7de15b8 | |
SQFMI | 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
|
||||
|
|
|
@ -322,18 +322,19 @@ void Watchy::showAbout() {
|
|||
display.setTextColor(GxEPD_WHITE);
|
||||
display.setCursor(0, 20);
|
||||
|
||||
//Library Version
|
||||
display.print("LibVer: ");
|
||||
display.println(WATCHY_LIB_VER);
|
||||
|
||||
//RTC Type
|
||||
const char *RTC_HW[3] = {"<UNKNOWN>", "DS3231", "PCF8563"};
|
||||
display.print("RTC: ");
|
||||
display.println(RTC_HW[RTC.rtcType]); // 0 = UNKNOWN, 1 = DS3231, 2 = PCF8563
|
||||
|
||||
//Battery Level
|
||||
display.print("Batt: ");
|
||||
float voltage = getBatteryVoltage();
|
||||
display.print(voltage);
|
||||
display.println("V");
|
||||
|
||||
//Uptime
|
||||
display.print("Uptime: ");
|
||||
RTC.read(currentTime);
|
||||
time_t b = makeTime(bootTime);
|
||||
|
@ -342,13 +343,19 @@ void Watchy::showAbout() {
|
|||
//int seconds = (totalSeconds % 60);
|
||||
int minutes = (totalSeconds % 3600) / 60;
|
||||
int hours = (totalSeconds % 86400) / 3600;
|
||||
int days = (totalSeconds % (86400 * 30)) / 86400;
|
||||
int days = (totalSeconds % (86400 * 30)) / 86400;
|
||||
display.print(days);
|
||||
display.print("d");
|
||||
display.print(hours);
|
||||
display.print("h");
|
||||
display.print(minutes);
|
||||
display.print("m");
|
||||
display.println("m");
|
||||
//WiFi Info
|
||||
display.print("IP: ");
|
||||
display.println(WiFi.localIP());
|
||||
display.println("MAC Address:");
|
||||
display.println(WiFi.macAddress());
|
||||
|
||||
display.display(false); // full refresh
|
||||
|
||||
guiState = APP_STATE;
|
||||
|
@ -662,19 +669,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