-
-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FEATURE REQUEST] Redesign the Queue an make a class for each screen type #96
Comments
So every thing that is now done in the crazy switch statements could- be sorted into the clases so no more: switch (this->queue[i]->mode)
{
case MODE_EMPTY:
break;
case MODE_BLANK:
infotext = "blank";
break;
case MODE_COLOR:
infotext = "color";
break;
case MODE_CLOCK:
infotext = "clock";
break;
case MODE_DATE:
|
Great news, but I'm not much help here, I don't know C++. :) |
Since we abstract from the monolithic system, and make a modular one in which each page is a separate module with its own requisites. It seems to me that it would be good to transfer settings from the general config to the individual one for a page.
PS: In principle we can leave this in the general config as a default value for screens that don't have these individual settings. |
This will allow to display the date in 2 or 3 languages, for me it would be relevant Ukrainian, English, Korean, for our relatives, Spanish, English, Ukrainian. Now it is not possible. But in the new structure I don't see any obstacles. |
You have a very seldom use case but you're right. Problematic are the service calls from home assistant, there are no default parameters. So instead a
|
I was going to open an Issue in ESPHome about this, if it is not possible to set opional parameters in a service call. But if it is really impossible, although declared services in ESPHome Yaml can do it, and ywe can try to do it through them, then we can make a limited set of calls for each service with a different set of parameters. |
Like
|
If you can make a working version with at least one fully working screen, I'll try to add the others. |
And we can give only necessary parameters to the services, and everything else (rarely used) can be done through the ESPHome API, like here #96 (comment) |
When redesigning the queue the "icon|screen_id" syntax should be questioned. Also the now (thanks to @andrewjswan) more than 20 different screens are very confusing to beginners. Perhaps there is a way to make the service calls easier. The esphome api especially the service calls are the limiting factor. i have got no time to think about it in detail or even start coding, but using ehmtx should never be as hard as rocket-science. |
I found such a code in ESPHome, it registers the service registered in the API section, and it does not require complete completion of all parameters, maybe this will help us somehow?
|
The class
EHMTX_queue;
does not fit the features anymore.There should be more dynamic
std::list
instead, and there should be a class for each screen type to move the complexity fromvoid EHMTX_queue::draw()
to the separate screen classes. The base class should only contain the attributes common to all screens. I started to "sketch" it in m8trx32.h, but I have no time to develop this right now.The result would be a much cleaner code with more dynamic, the number of different screens would be limited only by RAM. The screen identifier could be cleanly separated from the icon into an attribute, instead of the workaround with the "|". So it would also be possible to have multiple bitmap_screen if there is enough RAM.
The text was updated successfully, but these errors were encountered: