This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // Handle POST request with timezone data | |
| $postData = null; | |
| $timezoneOffset = 3; // Default EEST offset in hours | |
| $userTimezone = 'Europe/Helsinki'; // Default timezone | |
| if ($_SERVER['REQUEST_METHOD'] === 'POST') { | |
| $postJson = file_get_contents('php://input'); | |
| $postData = json_decode($postJson, true); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // Handle POST request with timezone data | |
| $postData = null; | |
| $timezoneOffset = 3; // Default EEST offset in hours | |
| $userTimezone = 'Europe/Helsinki'; // Default timezone | |
| $zone = "FI"; | |
| $vat = 1.255; | |
| if (isset($_GET['z'])) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include "libbs.h" | |
| #include <stdint.h> | |
| #include <cstdint> | |
| #include <cstdio> | |
| #include <sys/types.h> | |
| /* | |
| * "MonsterID" is encoded Mesh ID composed for charging station updates, so far used only for CarWings CP updates | |
| */ | |
| int32_t UnpackMonsterIDIntoMeshID(int32_t monsterId) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import argparse | |
| def compute_checksum_and_verify(data: bytes) -> bool: | |
| data_array = bytearray(data) | |
| checksum_offset = 0x30 | |
| # Read and temporarily clear the stored checksum for region 0 | |
| original_checksum = int.from_bytes(data_array[checksum_offset:checksum_offset+2], byteorder='little') | |
| data_array[checksum_offset:checksum_offset+2] = [0, 0] | |
| # Calculate checksum by summing all bytes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| template: | |
| - binary_sensor: | |
| - name: "EV Charging" | |
| unique_id: ev_charging | |
| device_class: battery_charging | |
| state: > | |
| {{ state_attr('sensor.ev_raw_data', 'ev_info').charging }} | |
| - name: "EV Quick Charging" | |
| unique_id: ev_qc_charging | |
| device_class: battery_charging |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import sys | |
| import struct | |
| def extract_firmware(input_file, output_file): | |
| DEFAULT_OUTPUT_SIZE = 300 * 1024 * 1024 # 1MB | |
| total_bytes_extracted = 0 | |
| try: | |
| with open(input_file, "rb") as infile: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import requests | |
| # Wilma2SID= cookie value here | |
| SESSION = "" | |
| # Your Wilma Base URL | |
| BASEURL = "https://example.inschool.fi/!0249962/" | |
| # Schedule ID as ENV if you know already, otherwise select using CLI | |
| SCHEDULE = os.environ.get("SCHEDULE", '') | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const {parseData} = require('./utils'); | |
| let jsonConf = "{\"others\":[{\"data\":\"1,585,75\",\"text\":\"vENA11.1, tukikurssi\"},{\"data\":\"1,670,105\",\"text\":\"vSAA05.1\"},{\"data\":\"1,785,75\",\"text\":\"vMAA05.3\"},{\"data\":\"1,870,75\",\"text\":\"vYH02.3\"},{\"data\":\"2,585,75\",\"text\":\"vSAA05.1\"},{\"data\":\"2,670,105\",\"text\":\"vÄI04.2\"},{\"data\":\"2,870,75\",\"text\":\"vOP06.3, HYK20C, klo 13.05-13.20\"},{\"data\":\"3,495,75\",\"text\":\"vYH02.3\"},{\"data\":\"3,585,75\",\"text\":\"vÄI04.2\"},{\"data\":\"3,670,105\",\"text\":\"vENA11.1, tukikurssi\"},{\"data\":\"4,585,75\",\"text\":\"vMAA05.3\"},{\"data\":\"4,670,105\",\"text\":\"vSAA05.1\"},{\"data\":\"4,785,75\",\"text\":\"vYH02.3\"},{\"data\":\"5,585,75\",\"text\":\"vENA11.1, tukikurssi\"},{\"data\":\"5,670,105\",\"text\":\"vMAA05.3\"},{\"data\":\"5,785,75\",\"text\":\"vÄI04.2\"}],\"checksum\":\"CE2089E\"}"; | |
| jsonConf = JSON.parse(jsonConf); | |
| let multiplier = 1; | |
| let globalItems = []; | |
| jsonConf.others.forEach(item => { | |
| let items = pars |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import json | |
| from datetime import datetime | |
| import remotezip | |
| import requests | |
| versionList = [] | |
| versions = { | |
| "ktp": [], | |
| "koe": [] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <Servo.h> | |
| void setup() { | |
| // put your setup code here, to run once: | |
| Serial.begin(9600); | |
| pinMode(LED_BUILTIN, OUTPUT); | |
| digitalWrite(LED_BUILTIN, HIGH); | |
| } | |
| void loop() { |
NewerOlder