mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-07-22 18:56:34 +00:00
Update license
This commit is contained in:
parent
51ca8ca68b
commit
fea72ad701
5
LICENSE
5
LICENSE
@ -1,7 +1,8 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2020 Francis Van Roie francis@netwize.be
|
||||
Copyright (c) 2019 Allen Derusha allen@derusha.org
|
||||
Copyright (c) 2020 Francis Van Roie
|
||||
|
||||
Based upon HASwitchPlate - Copyright (c) 2019 Allen Derusha allen@derusha.org
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -1,3 +1,6 @@
|
||||
; MIT License - Copyright (c) 2020 Francis Van Roie
|
||||
; For full license information read the LICENSE file in the project folder
|
||||
;
|
||||
; Copy this file and rename it to platformio_override.ini
|
||||
; ONLY edit platformio_override.ini to make local changes to the parameters
|
||||
;
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*********************
|
||||
* INCLUDES
|
||||
*********************/
|
||||
/* MIT License - Copyright (c) 2020 Francis Van Roie
|
||||
For full license information read the LICENSE file in the project folder */
|
||||
|
||||
#include "hasp_conf.h"
|
||||
#include <Arduino.h>
|
||||
#include "ArduinoLog.h"
|
||||
@ -518,6 +518,9 @@ void haspSetPage(uint8_t pageid)
|
||||
Log.notice(TAG_HASP, F("Changing page to %u"), pageid);
|
||||
current_page = pageid;
|
||||
lv_scr_load(page);
|
||||
|
||||
hasp_object_tree(page, pageid, 0);
|
||||
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,5 @@
|
||||
/**
|
||||
* @file hasp.h
|
||||
*
|
||||
*/
|
||||
/* MIT License - Copyright (c) 2020 Francis Van Roie
|
||||
For full license information read the LICENSE file in the project folder */
|
||||
|
||||
#ifndef HASP_H
|
||||
#define HASP_H
|
||||
|
@ -1,3 +1,6 @@
|
||||
/* MIT License - Copyright (c) 2020 Francis Van Roie
|
||||
For full license information read the LICENSE file in the project folder */
|
||||
|
||||
#include "ArduinoJson.h"
|
||||
#include "ArduinoLog.h"
|
||||
|
||||
|
@ -1,3 +1,6 @@
|
||||
/* MIT License - Copyright (c) 2020 Francis Van Roie
|
||||
For full license information read the LICENSE file in the project folder */
|
||||
|
||||
#ifndef HASP_ATTR_SET_H
|
||||
#define HASP_ATTR_SET_H
|
||||
|
||||
|
@ -1,3 +1,6 @@
|
||||
/* MIT License - Copyright (c) 2020 Francis Van Roie
|
||||
For full license information read the LICENSE file in the project folder */
|
||||
|
||||
#include "Arduino.h"
|
||||
#include "ArduinoLog.h"
|
||||
#include "ArduinoJson.h"
|
||||
|
@ -1,3 +1,6 @@
|
||||
/* MIT License - Copyright (c) 2020 Francis Van Roie
|
||||
For full license information read the LICENSE file in the project folder */
|
||||
|
||||
#ifndef HASP_CONFIG_H
|
||||
#define HASP_CONFIG_H
|
||||
|
||||
|
@ -1,3 +1,6 @@
|
||||
/* MIT License - Copyright (c) 2020 Francis Van Roie
|
||||
For full license information read the LICENSE file in the project folder */
|
||||
|
||||
#include "ArduinoJson.h"
|
||||
#include "ArduinoLog.h"
|
||||
#include "lvgl.h"
|
||||
|
@ -1,3 +1,6 @@
|
||||
/* MIT License - Copyright (c) 2020 Francis Van Roie
|
||||
For full license information read the LICENSE file in the project folder */
|
||||
|
||||
#ifndef HASP_DEBUG_H
|
||||
#define HASP_DEBUG_H
|
||||
|
||||
|
@ -1,3 +1,6 @@
|
||||
/* MIT License - Copyright (c) 2020 Francis Van Roie
|
||||
For full license information read the LICENSE file in the project folder */
|
||||
|
||||
#include "ArduinoJson.h"
|
||||
#include "ArduinoLog.h"
|
||||
#include "StringStream.h"
|
||||
|
@ -1,3 +1,6 @@
|
||||
/* MIT License - Copyright (c) 2020 Francis Van Roie
|
||||
For full license information read the LICENSE file in the project folder */
|
||||
|
||||
#ifndef HASP_DISPATCH_H
|
||||
#define HASP_DISPATCH_H
|
||||
|
||||
|
@ -1,3 +1,6 @@
|
||||
/* MIT License - Copyright (c) 2020 Francis Van Roie
|
||||
For full license information read the LICENSE file in the project folder */
|
||||
|
||||
#include <Arduino.h>
|
||||
#include "EEPROM.h"
|
||||
|
||||
|
@ -1,3 +1,6 @@
|
||||
/* MIT License - Copyright (c) 2020 Francis Van Roie
|
||||
For full license information read the LICENSE file in the project folder */
|
||||
|
||||
#ifndef HASP_EEPROM_H
|
||||
#define HASP_EEPROM_H
|
||||
|
||||
|
@ -1,3 +1,6 @@
|
||||
/* MIT License - Copyright (c) 2020 Francis Van Roie
|
||||
For full license information read the LICENSE file in the project folder */
|
||||
|
||||
#include <Arduino.h>
|
||||
#include "ArduinoJson.h"
|
||||
#include "ArduinoLog.h"
|
||||
|
@ -1,3 +1,6 @@
|
||||
/* MIT License - Copyright (c) 2020 Francis Van Roie
|
||||
For full license information read the LICENSE file in the project folder */
|
||||
|
||||
#ifndef HASP_ETHERNET_H
|
||||
#define HASP_ETHERNET_H
|
||||
|
||||
|
@ -1,3 +1,6 @@
|
||||
/* MIT License - Copyright (c) 2020 Francis Van Roie
|
||||
For full license information read the LICENSE file in the project folder */
|
||||
|
||||
#include <Arduino.h>
|
||||
#include "ArduinoJson.h"
|
||||
#include "ArduinoLog.h"
|
||||
|
@ -1,3 +1,6 @@
|
||||
/* MIT License - Copyright (c) 2020 Francis Van Roie
|
||||
For full license information read the LICENSE file in the project folder */
|
||||
|
||||
#ifndef HASP_ETHERNET_ESP32_H
|
||||
#define HASP_ETHERNET_ESP32_H
|
||||
|
||||
|
@ -1,3 +1,6 @@
|
||||
/* MIT License - Copyright (c) 2020 Francis Van Roie
|
||||
For full license information read the LICENSE file in the project folder */
|
||||
|
||||
#include "Arduino.h"
|
||||
#include "ArduinoLog.h"
|
||||
|
||||
|
@ -1,3 +1,6 @@
|
||||
/* MIT License - Copyright (c) 2020 Francis Van Roie
|
||||
For full license information read the LICENSE file in the project folder */
|
||||
|
||||
#ifndef HASP_GPIO_H
|
||||
#define HASP_GPIO_H
|
||||
|
||||
|
@ -1,3 +1,6 @@
|
||||
/* MIT License - Copyright (c) 2020 Francis Van Roie
|
||||
For full license information read the LICENSE file in the project folder */
|
||||
|
||||
#include "Ticker.h"
|
||||
#include "ArduinoLog.h"
|
||||
|
||||
|
@ -1,3 +1,6 @@
|
||||
/* MIT License - Copyright (c) 2020 Francis Van Roie
|
||||
For full license information read the LICENSE file in the project folder */
|
||||
|
||||
#ifndef HASP_GUI_H
|
||||
#define HASP_GUI_H
|
||||
|
||||
|
@ -1,3 +1,6 @@
|
||||
/* MIT License - Copyright (c) 2020 Francis Van Roie
|
||||
For full license information read the LICENSE file in the project folder */
|
||||
|
||||
//#include "webServer.h"
|
||||
#include "Arduino.h"
|
||||
#include "ArduinoJson.h"
|
||||
|
@ -1,3 +1,6 @@
|
||||
/* MIT License - Copyright (c) 2020 Francis Van Roie
|
||||
For full license information read the LICENSE file in the project folder */
|
||||
|
||||
#ifndef HASP_HTTP_H
|
||||
#define HASP_HTTP_H
|
||||
|
||||
|
@ -1,3 +1,6 @@
|
||||
/* MIT License - Copyright (c) 2020 Francis Van Roie
|
||||
For full license information read the LICENSE file in the project folder */
|
||||
|
||||
#include "ArduinoJson.h"
|
||||
#include "ArduinoLog.h"
|
||||
|
||||
|
@ -1,3 +1,6 @@
|
||||
/* MIT License - Copyright (c) 2020 Francis Van Roie
|
||||
For full license information read the LICENSE file in the project folder */
|
||||
|
||||
#ifndef HASP_MDNS_H
|
||||
#define HASP_MDNS_H
|
||||
|
||||
|
@ -1,3 +1,6 @@
|
||||
/* MIT License - Copyright (c) 2020 Francis Van Roie
|
||||
For full license information read the LICENSE file in the project folder */
|
||||
|
||||
/* ********************************************************************************************
|
||||
*
|
||||
* HASP Object Handlers
|
||||
@ -156,6 +159,37 @@ bool check_obj_type(lv_obj_t * obj, lv_hasp_obj_type_t haspobjtype)
|
||||
return check_obj_type(objtype, haspobjtype);
|
||||
}
|
||||
|
||||
void hasp_object_tree(lv_obj_t * parent, uint8_t pageid, uint16_t level)
|
||||
{
|
||||
if(parent == nullptr) return;
|
||||
|
||||
/* Output parent info */
|
||||
lv_obj_type_t list;
|
||||
lv_obj_get_type(parent, &list);
|
||||
const char * objtype = list.type[0];
|
||||
Log.verbose(TAG_HASP, F("[%d] p[%d].b[%d] %s"), level, pageid, parent->user_data, objtype);
|
||||
|
||||
lv_obj_t * child;
|
||||
child = lv_obj_get_child(parent, NULL);
|
||||
while(child) {
|
||||
/* child found, process it */
|
||||
if(child->user_data) hasp_object_tree(child, pageid, level + 1);
|
||||
|
||||
/* try next sibling */
|
||||
child = lv_obj_get_child(parent, child);
|
||||
}
|
||||
|
||||
/* check tabs */
|
||||
if(check_obj_type(parent, LV_HASP_TABVIEW)) {
|
||||
uint16_t tabcount = lv_tabview_get_tab_count(parent);
|
||||
for(uint16_t i = 0; i < tabcount; i++) {
|
||||
lv_obj_t * tab = lv_tabview_get_tab(child, i);
|
||||
Log.verbose(TAG_HASP, "Found tab %i", i);
|
||||
if(tab->user_data) hasp_object_tree(tab, pageid, level + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ##################### Value Dispatchers ########################################################
|
||||
|
||||
void hasp_send_obj_attribute_str(lv_obj_t * obj, const char * attribute, const char * data)
|
||||
|
@ -1,3 +1,6 @@
|
||||
/* MIT License - Copyright (c) 2020 Francis Van Roie
|
||||
For full license information read the LICENSE file in the project folder */
|
||||
|
||||
#ifndef HASP_OBJECT_H
|
||||
#define HASP_OBJECT_H
|
||||
|
||||
@ -52,6 +55,7 @@ lv_obj_t * hasp_find_obj_from_id(uint8_t pageid, uint8_t objid);
|
||||
bool hasp_find_id_from_obj(lv_obj_t * obj, uint8_t * pageid, lv_obj_user_data_t * objid);
|
||||
bool check_obj_type(const char * lvobjtype, lv_hasp_obj_type_t haspobjtype);
|
||||
bool check_obj_type(lv_obj_t * obj, lv_hasp_obj_type_t haspobjtype);
|
||||
void hasp_object_tree(lv_obj_t * parent, uint8_t pageid, uint16_t level);
|
||||
|
||||
void hasp_send_obj_attribute_str(lv_obj_t * obj, const char * attribute, const char * data);
|
||||
void hasp_send_obj_attribute_int(lv_obj_t * obj, const char * attribute, int32_t val);
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*********************
|
||||
* INCLUDES
|
||||
*********************/
|
||||
/* MIT License - Copyright (c) 2020 Francis Van Roie
|
||||
For full license information read the LICENSE file in the project folder */
|
||||
|
||||
#include "hasp_conf.h"
|
||||
#include <Arduino.h>
|
||||
#include "ArduinoJson.h"
|
||||
|
@ -1,3 +1,6 @@
|
||||
/* MIT License - Copyright (c) 2020 Francis Van Roie
|
||||
For full license information read the LICENSE file in the project folder */
|
||||
|
||||
void oobeSetAutoCalibrate(bool cal);
|
||||
bool oobeSetup();
|
||||
void oobeFakeSetup(const char *);
|
@ -1,3 +1,6 @@
|
||||
/* MIT License - Copyright (c) 2020 Francis Van Roie
|
||||
For full license information read the LICENSE file in the project folder */
|
||||
|
||||
#if defined(ARDUINO_ARCH_ESP8266) || defined(ARDUINO_ARCH_ESP32)
|
||||
#include <Arduino.h>
|
||||
#include <ArduinoOTA.h>
|
||||
|
@ -1,3 +1,6 @@
|
||||
/* MIT License - Copyright (c) 2020 Francis Van Roie
|
||||
For full license information read the LICENSE file in the project folder */
|
||||
|
||||
#if defined(ARDUINO_ARCH_ESP8266) || defined(ARDUINO_ARCH_ESP32)
|
||||
|
||||
#ifndef HASP_OTA_H
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*********************
|
||||
* INCLUDES
|
||||
*********************/
|
||||
/* MIT License - Copyright (c) 2020 Francis Van Roie
|
||||
For full license information read the LICENSE file in the project folder */
|
||||
|
||||
#if HASP_USE_TASMOTA_SLAVE>0
|
||||
|
||||
#include "hasp_slave.h"
|
||||
|
@ -1,3 +1,6 @@
|
||||
/* MIT License - Copyright (c) 2020 Francis Van Roie
|
||||
For full license information read the LICENSE file in the project folder */
|
||||
|
||||
#ifndef HASP_SLAVE_H
|
||||
#define HASP_SLAVE_H
|
||||
|
||||
|
@ -1,3 +1,6 @@
|
||||
/* MIT License - Copyright (c) 2020 Francis Van Roie
|
||||
For full license information read the LICENSE file in the project folder */
|
||||
|
||||
#include "hasp_conf.h"
|
||||
#if HASP_USE_TELNET > 0
|
||||
|
||||
|
@ -1,3 +1,6 @@
|
||||
/* MIT License - Copyright (c) 2020 Francis Van Roie
|
||||
For full license information read the LICENSE file in the project folder */
|
||||
|
||||
#include "hasp_conf.h"
|
||||
|
||||
#ifndef HASP_TELNET_H
|
||||
|
@ -1,3 +1,6 @@
|
||||
/* MIT License - Copyright (c) 2020 Francis Van Roie
|
||||
For full license information read the LICENSE file in the project folder */
|
||||
|
||||
#include "ArduinoJson.h"
|
||||
#include "ArduinoLog.h"
|
||||
|
||||
|
@ -1,3 +1,6 @@
|
||||
/* MIT License - Copyright (c) 2020 Francis Van Roie
|
||||
For full license information read the LICENSE file in the project folder */
|
||||
|
||||
#ifndef HASP_TFT_H
|
||||
#define HASP_TFT_H
|
||||
|
||||
|
@ -1,3 +1,6 @@
|
||||
/* MIT License - Copyright (c) 2020 Francis Van Roie
|
||||
For full license information read the LICENSE file in the project folder */
|
||||
|
||||
#include <Arduino.h>
|
||||
#include "ArduinoJson.h"
|
||||
#include "ArduinoLog.h"
|
||||
|
@ -1,3 +1,6 @@
|
||||
/* MIT License - Copyright (c) 2020 Francis Van Roie
|
||||
For full license information read the LICENSE file in the project folder */
|
||||
|
||||
#ifndef HASP_WIFI_H
|
||||
#define HASP_WIFI_H
|
||||
|
||||
|
@ -1,3 +1,6 @@
|
||||
/* MIT License - Copyright (c) 2020 Francis Van Roie
|
||||
For full license information read the LICENSE file in the project folder */
|
||||
|
||||
#include "hasp_conf.h" // load first
|
||||
#include <Arduino.h>
|
||||
|
||||
@ -35,7 +38,7 @@ void setup()
|
||||
* Read & Apply User Configuration
|
||||
***************************/
|
||||
configSetup();
|
||||
|
||||
|
||||
dispatchSetup();
|
||||
|
||||
/****************************
|
||||
|
@ -1,9 +1,14 @@
|
||||
/* MIT License - Copyright (c) 2020 Francis Van Roie
|
||||
For full license information read the LICENSE file in the project folder */
|
||||
|
||||
/***************************************************
|
||||
// This file contains the default settings that are
|
||||
// burned into the compiled firmware.
|
||||
//
|
||||
// These default settings can be changed at runtime
|
||||
//
|
||||
// To use: Save a copy as user_config_override.h
|
||||
***************************************************/
|
||||
|
||||
#define SERIAL_SPEED 115200
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user