Files
dashboard/dashboard/ui/climate.slint
2026-08-08 13:56:02 +02:00

108 lines
3.0 KiB
Plaintext

/*
in property <string> : "--";
in property <string> : "HIGH --";
in property <string> : "CONNECTING";
in property <string> : "cloud";
*/
export struct WeatherData {
temperature: float,
dew_point: float,
temperature_unit: string,
humidity: int,
cloud_coverage: int,
uv_index: float,
pressure: float,
pressure_unit: string,
wind_bearing: float,
wind_speed: float,
wind_speed_unit: string,
visibility_unit: string,
precipitation_unit: string,
attribution: string,
friendly_name: string,
supported_features: int,
}
export component Climate inherits Rectangle {
in property <WeatherData> weather;
Text {
width: 300px;
height: 116px;
text: "\{weather.temperature}\{weather.temperature-unit}";
font-size: 104px;
font-weight: 700;
vertical-alignment: center;
}
// Text {
// width: 150px;
// height: 32px;
// text: weather.outside-high;
// font-size: 20px;
// font-weight: 700;
// vertical-alignment: center;
// }
// if weather.weather-kind == "sun": Image {
// width: 120px;
// height: 105px;
// source: @image-url("icons/sun.svg");
// image-fit: contain;
// }
// if weather.weather-kind == "cloud-sun": Image {
// width: 120px;
// height: 105px;
// source: @image-url("icons/cloud-sun.svg");
// image-fit: contain;
// }
// if weather.weather-kind == "cloud-moon": Image {
// width: 120px;
// height: 105px;
// source: @image-url("icons/cloud-moon.svg");
// image-fit: contain;
// }
// if weather.weather-kind == "cloud": Image {
// width: 120px;
// height: 105px;
// source: @image-url("icons/cloud.svg");
// image-fit: contain;
// }
// if weather.weather-kind == "cloud-rain": Image {
// width: 120px;
// height: 105px;
// source: @image-url("icons/cloud-rain.svg");
// image-fit: contain;
// }
// if weather.weather-kind == "cloud-rain-wind": Image {
// width: 120px;
// height: 105px;
// source: @image-url("icons/cloud-rain-wind.svg");
// image-fit: contain;
// }
// if weather.weather-kind == "cloud-lightning": Image {
// width: 120px;
// height: 105px;
// source: @image-url("icons/cloud-lightning.svg");
// image-fit: contain;
// }
// if weather.weather-kind == "snowflake": Image {
// width: 120px;
// height: 105px;
// source: @image-url("icons/snowflake.svg");
// image-fit: contain;
// }
// if weather.weather-kind == "cloud-fog": Image {
// width: 120px;
// height: 105px;
// source: @image-url("icons/cloud-fog.svg");
// image-fit: contain;
// }
// if weather.weather-kind == "moon": Image {
// width: 120px;
// height: 105px;
// source: @image-url("icons/moon.svg");
// image-fit: contain;
// }
}