diff --git a/src/main.cpp b/src/main.cpp index 5da5d42..395688c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -16,7 +16,7 @@ int main(int argc, char** argv){ dashboard::board _board(false); if(_board.init() != 0){ - std::cerr << "Due to errors, " << argv[0] + std::cerr << "Due to errors, " << argv[0] << " was unable to start, quitting!" << std::endl; return -1; } diff --git a/src/panel/homeassistant.cpp b/src/panel/homeassistant.cpp index dec10b9..4c39514 100644 --- a/src/panel/homeassistant.cpp +++ b/src/panel/homeassistant.cpp @@ -62,7 +62,7 @@ void homeassistant::draw(){ } //check if its time to update - if((std::chrono::high_resolution_clock::now() - _last_update) + if((std::chrono::high_resolution_clock::now() - _last_update) > _update_interval){ update(); diff --git a/src/panel/plex.cpp b/src/panel/plex.cpp index 08a3c4d..2264a21 100644 --- a/src/panel/plex.cpp +++ b/src/panel/plex.cpp @@ -50,7 +50,7 @@ void plex::draw(){ } //check if its time to update - if((std::chrono::high_resolution_clock::now() - _last_update) + if((std::chrono::high_resolution_clock::now() - _last_update) > _update_interval){ update(); @@ -84,13 +84,13 @@ void plex::update(){ for(short i = 0; i < 4; ++i){ entries.at(i) = { - truncate(curr_entry[i]["friendly_name"].GetString(), + truncate(curr_entry[i]["friendly_name"].GetString(), PLEX_MAX_STRING_LENGTH), - truncate(curr_entry[i]["ip_address"].GetString(), + truncate(curr_entry[i]["ip_address"].GetString(), PLEX_MAX_STRING_LENGTH), - truncate(curr_entry[i]["title"].GetString(), + truncate(curr_entry[i]["title"].GetString(), PLEX_MAX_STRING_LENGTH), - truncate(curr_entry[i]["state"].IsNull() ? "Historical" : "Playing", + truncate(curr_entry[i]["state"].IsNull() ? "Historical" : "Playing", PLEX_MAX_STRING_LENGTH), }; diff --git a/src/panel/plex_config.hpp b/src/panel/plex_config.hpp index 9e115c8..bfa44b3 100644 --- a/src/panel/plex_config.hpp +++ b/src/panel/plex_config.hpp @@ -13,7 +13,7 @@ namespace dashboard::panel { //string to not show anything constexpr char PLEX_TITLE[] = "Plex"; - //Tautili endpoint + //Tautili endpoint constexpr char PLEX_URL_SOURCE_HISTORY[] = "http://192.168.1.104:8181/api/v2?apikey=62917cc0bea04aa69cbb85141e312e84&cmd=get_history&length=5"; constexpr char PLEX_URL_SOURCE_NAME[] = "http://192.168.1.104:8181/api/v2?apikey=62917cc0bea04aa69cbb85141e312e84&cmd=get_server_friendly_name"; constexpr char PLEX_URL_SOURCE_TOP_USERS[] = "http://192.168.1.104:8181/api/v2?apikey=62917cc0bea04aa69cbb85141e312e84&cmd=get_plays_by_top_10_users"; @@ -34,5 +34,4 @@ namespace dashboard::panel { constexpr uint8_t PLEX_BGBOX_GREEN = 0x66; constexpr uint8_t PLEX_BGBOX_BLUE = 0x66; constexpr uint8_t PLEX_BGBOX_ALPHA = 0x99; - } diff --git a/src/panel/weather_config.hpp b/src/panel/weather_config.hpp index 498fe85..7ef2f87 100644 --- a/src/panel/weather_config.hpp +++ b/src/panel/weather_config.hpp @@ -36,57 +36,57 @@ namespace dashboard::panel { //with weather string being the string shown on screen, and weather image //being the name of the preloaded image file to be shown. It is best that //these images be square. - const std::pair WEATHER_CLEAR_DAY = + const std::pair WEATHER_CLEAR_DAY = {"Clear skies", "clearday.png"}; - const std::pair WEATHER_CLEAR_NIGHT = + const std::pair WEATHER_CLEAR_NIGHT = {"Clear skies", "clearnight.png"}; - const std::pair WEATHER_PCLOUDY_DAY = + const std::pair WEATHER_PCLOUDY_DAY = {"Slightly cloudy", "cloudyday.png"}; - const std::pair WEATHER_PCLOUDY_NIGHT = + const std::pair WEATHER_PCLOUDY_NIGHT = {"Slightly cloudy", "cloudynight.png"}; - const std::pair WEATHER_MCLOUDY_DAY = + const std::pair WEATHER_MCLOUDY_DAY = {"Moderately cloudy", "cloudyday.png"}; - const std::pair WEATHER_MCLOUDY_NIGHT = + const std::pair WEATHER_MCLOUDY_NIGHT = {"Moderately cloudy", "cloudynight.png"}; - const std::pair WEATHER_CLOUDY_DAY = + const std::pair WEATHER_CLOUDY_DAY = {"Very cloudy", "cloudyday.png"}; - const std::pair WEATHER_CLOUDY_NIGHT = + const std::pair WEATHER_CLOUDY_NIGHT = {"Very cloudy", "cloudynight.png"}; - const std::pair WEATHER_HUMID_DAY = + const std::pair WEATHER_HUMID_DAY = {"Very humid", "humidday.png"}; - const std::pair WEATHER_HUMID_NIGHT = + const std::pair WEATHER_HUMID_NIGHT = {"Very humid", "humidnight.png"}; - const std::pair WEATHER_LRAIN_DAY = + const std::pair WEATHER_LRAIN_DAY = {"Light rain", "lrainday.png"}; - const std::pair WEATHER_LRAIN_NIGHT = + const std::pair WEATHER_LRAIN_NIGHT = {"Light rain", "lrainnight.png"}; - const std::pair WEATHER_RAIN_DAY = + const std::pair WEATHER_RAIN_DAY = {"Rain", "rainday.png"}; - const std::pair WEATHER_RAIN_NIGHT = + const std::pair WEATHER_RAIN_NIGHT = {"Rain", "rainnight.png"}; - const std::pair WEATHER_OSHOWER_DAY = + const std::pair WEATHER_OSHOWER_DAY = {"Overcast with showers", "shower.png"}; - const std::pair WEATHER_OSHOWER_NIGHT = + const std::pair WEATHER_OSHOWER_NIGHT = {"Overcast with showers", "shower.png"}; - const std::pair WEATHER_ISHOWER_DAY = + const std::pair WEATHER_ISHOWER_DAY = {"Moderate showers", "shower.png"}; - const std::pair WEATHER_ISHOWER_NIGHT = + const std::pair WEATHER_ISHOWER_NIGHT = {"Moderate showers", "shower.png"}; - const std::pair WEATHER_LSNOW_DAY = + const std::pair WEATHER_LSNOW_DAY = {"Light snow", "snowday.png"}; const std::pair WEATHER_LSNOW_NIGHT = {"Light snow", "snownight.png"}; - const std::pair WEATHER_SNOW_DAY = + const std::pair WEATHER_SNOW_DAY = {"Moderate snow", "snowday.png"}; const std::pair WEATHER_SNOW_NIGHT = {"Moderate snow", "snownight.png"};