• Creato un nuovo file CSS per gli stili del chiosco (kiosk) con variabili, stili per le schede (card) e animazioni. • Aggiunto un file HTML per l'interfaccia della mappa utilizzando Mapbox, inclusi gli stili e il JavaScript per le funzionalità della mappa. • Introdotto un file JSON per i riferimenti ai sensori, definendo percorsi ed elementi per i dati di temperatura, vento, onde, posizione, batteria, motore e sistema. Co-authored-by: Copilot <copilot@github.com>
30 lines
940 B
JavaScript
30 lines
940 B
JavaScript
const skFlow = require('../../config/skFlow');
|
|
const { liveMarkup } = require('../utility/live');
|
|
|
|
module.exports = {
|
|
command: 'weather',
|
|
handler: (bot, msg) => {
|
|
const chatId = msg.chat.id;
|
|
const data = skFlow.getWithFilter('meb.forecast');
|
|
|
|
let text = '';
|
|
|
|
if (!data || Object.keys(data).length === 0) {
|
|
text = 'Nessun dato meteo disponibile.';
|
|
} else {
|
|
text = '*Dati Meteo*\n\n';
|
|
for (const [path, value] of Object.entries(data)) {
|
|
const displayValue = typeof value === 'object' ? JSON.stringify(value) : value;
|
|
//TODO: ADD units
|
|
text += `*${path}*: ${displayValue}\n`;
|
|
}
|
|
}
|
|
|
|
bot.sendMessage(chatId, text, {
|
|
parse_mode: 'Markdown',
|
|
reply_to_message_id: msg.message_id,
|
|
reply_markup: liveMarkup(msg.message_id, 'weather')
|
|
});
|
|
}
|
|
};
|