mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-07-27 05:06:44 +00:00
Add id attribute
This commit is contained in:
parent
12f02d2917
commit
cbea0776c0
@ -32,12 +32,12 @@ static uint8_t lv_roller_get_visible_row_count(lv_obj_t * roller)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// OK
|
// OK
|
||||||
static lv_color_t haspLogColor(lv_color_t color)
|
static inline lv_color_t haspLogColor(lv_color_t color)
|
||||||
{
|
{
|
||||||
uint8_t r = (LV_COLOR_GET_R(color) * 263 + 7) >> 5;
|
// uint8_t r = (LV_COLOR_GET_R(color) * 263 + 7) >> 5;
|
||||||
uint8_t g = (LV_COLOR_GET_G(color) * 259 + 3) >> 6;
|
// uint8_t g = (LV_COLOR_GET_G(color) * 259 + 3) >> 6;
|
||||||
uint8_t b = (LV_COLOR_GET_B(color) * 263 + 7) >> 5;
|
// uint8_t b = (LV_COLOR_GET_B(color) * 263 + 7) >> 5;
|
||||||
Log.trace(F("Color: R%u G%u B%u"), r, g, b);
|
// Log.trace(F("Color: R%u G%u B%u"), r, g, b);
|
||||||
return color;
|
return color;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -602,6 +602,18 @@ static void hasp_process_obj_attribute1(lv_obj_t * obj, const char * attr, const
|
|||||||
hasp_local_style_attr(obj, attr, payload, update);
|
hasp_local_style_attr(obj, attr, payload, update);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// OK
|
||||||
|
static void hasp_process_obj_attribute2(lv_obj_t * obj, const char * attr, const char * payload, bool update)
|
||||||
|
{
|
||||||
|
int16_t val = atoi(payload);
|
||||||
|
|
||||||
|
if(!strcmp_P(attr, PSTR("id"))) {
|
||||||
|
return update ? (void)(obj->user_data = (uint8_t)val) : hasp_out_int(obj, attr, obj->user_data);
|
||||||
|
}
|
||||||
|
|
||||||
|
hasp_local_style_attr(obj, attr, payload, update);
|
||||||
|
}
|
||||||
|
|
||||||
// OK
|
// OK
|
||||||
static void hasp_process_obj_attribute3(lv_obj_t * obj, const char * attr, const char * payload, bool update)
|
static void hasp_process_obj_attribute3(lv_obj_t * obj, const char * attr, const char * payload, bool update)
|
||||||
{
|
{
|
||||||
@ -641,6 +653,10 @@ static void hasp_process_obj_attribute4(lv_obj_t * obj, const char * attr, const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if(!strcmp_P(attr, PSTR("page"))) {
|
||||||
|
// return lv_obj_set_parent;
|
||||||
|
// }
|
||||||
|
|
||||||
/* Attributes depending on objecttype */
|
/* Attributes depending on objecttype */
|
||||||
lv_obj_type_t list;
|
lv_obj_type_t list;
|
||||||
lv_obj_get_type(obj, &list);
|
lv_obj_get_type(obj, &list);
|
||||||
@ -757,6 +773,9 @@ void hasp_process_obj_attribute(lv_obj_t * obj, const char * attr_p, const char
|
|||||||
case 1:
|
case 1:
|
||||||
hasp_process_obj_attribute1(obj, attr, payload, update);
|
hasp_process_obj_attribute1(obj, attr, payload, update);
|
||||||
break;
|
break;
|
||||||
|
case 2:
|
||||||
|
hasp_process_obj_attribute2(obj, attr, payload, update);
|
||||||
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
hasp_process_obj_attribute4(obj, attr, payload, update);
|
hasp_process_obj_attribute4(obj, attr, payload, update);
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user