Updated icons, buttons, and display; issues still with Main Room button, and sliders.
This commit is contained in:
1 parent
b5d6b4a897
commit
45998b6176
15 files changed
+973
-77
No files matched your search
+13
-8
@@ -52,12 +52,17 @@
|
||||
* template's entity list and the C table from one source makes that
|
||||
* impossible.
|
||||
*
|
||||
* X(entity_id, label, dimmable)
|
||||
* X(entity_id, label, dimmable, icon)
|
||||
*
|
||||
* `dimmable` is false for the patio, which is a TP-Link smart plug in the
|
||||
* switch domain -- on/off only, and it needs switch.turn_on rather than
|
||||
* light.turn_on. See ha_service_domain().
|
||||
*
|
||||
* `icon` is an ICON_* macro from main/ui/ui_icons.h. It rides along in this
|
||||
* list (rather than a parallel array in the UI) so a reorder here can never
|
||||
* put the sofa icon on the patio. Only ui_manager.c expands it; the api-layer
|
||||
* consumers ignore the argument, so this header does not include ui_icons.h.
|
||||
*
|
||||
* Note light.main_room is a GROUP containing blue_lamp, brown_lamp and
|
||||
* landing_chandelier. Toggling it changes three of the other tiles; that is
|
||||
* expected, and the UI reflects it on the next poll.
|
||||
@@ -65,12 +70,12 @@
|
||||
/* Labels must fit one line of Montserrat 16 in a ~125px tile -- roughly 11
|
||||
* characters. Longer ones are truncated with an ellipsis, which reads as a
|
||||
* mistake. "Dining Room" is one character too wide, hence "Dining". */
|
||||
#define HA_LIGHT_LIST(X) \
|
||||
X("light.main_room", "Main Room", true) \
|
||||
X("light.dining_room", "Dining", true) \
|
||||
X("light.blue_lamp", "Blue Lamp", true) \
|
||||
X("light.brown_lamp", "Brown Lamp", true) \
|
||||
X("light.landing_chandelier", "Chandelier", true) \
|
||||
X("switch.tp_link_smart_plug_f048_outdoor_hanging_lights", "Patio", false)
|
||||
#define HA_LIGHT_LIST(X) \
|
||||
X("light.main_room", "Main Room", true, ICON_SOFA) \
|
||||
X("light.dining_room", "Dining", true, ICON_DINING) \
|
||||
X("light.blue_lamp", "Blue Lamp", true, ICON_FLOOR_LAMP) \
|
||||
X("light.brown_lamp", "Brown Lamp", true, ICON_DESK_LAMP) \
|
||||
X("light.landing_chandelier", "Chandelier", true, ICON_CHANDELIER) \
|
||||
X("switch.tp_link_smart_plug_f048_outdoor_hanging_lights", "Patio", false, ICON_STRING_LIGHTS)
|
||||
|
||||
#endif
|
||||
+3
-2
@@ -16,8 +16,9 @@
|
||||
|
||||
#include "ha_data.h"
|
||||
|
||||
/* Build the config table from the same list the JSON template is built from. */
|
||||
#define HA_LIGHT_ENTRY_X(id, label, dimmable) { id, label, dimmable },
|
||||
/* Build the config table from the same list the JSON template is built from.
|
||||
* The icon argument belongs to the UI layer and is ignored here. */
|
||||
#define HA_LIGHT_ENTRY_X(id, label, dimmable, icon) { id, label, dimmable },
|
||||
const ha_light_cfg_t HA_LIGHTS[HA_LIGHT_COUNT] = {
|
||||
HA_LIGHT_LIST(HA_LIGHT_ENTRY_X)
|
||||
};
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@
|
||||
#define HA_FORECAST_DAYS 5
|
||||
|
||||
/* Derived from HA_LIGHT_LIST so the two can never disagree. */
|
||||
#define HA_LIGHT_COUNT_X(a, b, c) +1
|
||||
#define HA_LIGHT_COUNT_X(a, b, c, d) +1
|
||||
#define HA_LIGHT_COUNT (0 HA_LIGHT_LIST(HA_LIGHT_COUNT_X))
|
||||
|
||||
/*
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
|
||||
/* Emits the entity list for the lights loop, in HA_LIGHT_LIST order. The
|
||||
* trailing comma is deliberate -- Jinja accepts it, and it avoids a
|
||||
* last-element special case. */
|
||||
#define HA_TMPL_LIGHT_X(id, label, dimmable) "'" id "',"
|
||||
* last-element special case. The icon argument is the UI layer's. */
|
||||
#define HA_TMPL_LIGHT_X(id, label, dimmable, icon) "'" id "',"
|
||||
|
||||
/*
|
||||
* num() -- a state as a number, or null if it is not one ("unavailable",
|
||||
|
||||
Reference in new issue
Block a user