Comments (19)
one_checked
option from: https://docs.lvgl.io/8.3/widgets/core/btnmatrix.html#one-check
Already implemented.
we need on_value trigger to retrieve in x the ID of the button that was pressed.
Why? Each button in a button matrix can have its own actions. Although internally they are different to regular buttons, this is masked via the yaml config.
from esphome.
Why? Each button in a button matrix can have its own actions. Although internally they are different to regular buttons, this is masked via the yaml config.
For the users to easier implement something like key_collector to design an alarm input panel for example. With on_value
you could use the same action to receive the different button presses...
It's like when you need to input a sequence of numbers like a pin code - without having to define complicated scripts to concatenate incoming strings located in global variables.
Actually, key_collector
is a pretty well thought out component for this purpose. Maybe we could make btnmatrix
work with it?
Also see #34 (comment)
from esphome.
one_checked
option from: https://docs.lvgl.io/8.3/widgets/core/btnmatrix.html#one-checkAlready implemented.
Tested, config passes through the schema, but doesn't have any effect. Multiple buttons can stay checked.
from esphome.
Actually,
key_collector
is a pretty well thought out component for this purpose. Maybe we could makebtnmatrix
work with it?
Or maybe make key_collector
work with LVGL.
from esphome.
ested, config passes through the schema, but doesn't have any effect. Multiple buttons can stay checked.
Fixed.
from esphome.
Or maybe make
key_collector
work with LVGL.
I think both need to know about each other @ssieb
from esphome.
If the btnmatrix
provides the key_provider
interface, then it will work automatically.
from esphome.
@ssieb Can you point out a sample in the code?
from esphome.
Check out the wiegand
and matrix_keypad
components for example. It's very simple.
from esphome.
@clydebarrow maybe we could add a config option key_provider: true
to btnmatrix root, and simply provide the texts put on the buttons to it as keys (and not allow symbols in this case).
from esphome.
That will work, no need for the config option, and it will just send the first character of the button label (key_provider can only send single characters.)
from esphome.
Symbols are fine. If you want to send more than a single character, then just call the send method multiple times.
from esphome.
@ssieb symbols here are graphical elements, not just *# keys.
@clydebarrow I thought about config option because one may use multiple btnmatrix instances (eg page navigation etc) and likely wouldn't want to use key_provider with those.
from esphome.
Symbols in the LVGL world are just Unicode strings.
The btnmatrix won't send any keys unless it's connected to a key_collector.
from esphome.
The key interface only handles uint8_t
right now because it originally came from the keypad component. It could be expanded, but I'm not sure how useful that would be. What would you be using the keys for?
This should probably be a discord discussion. :-)
from esphome.
The btnmatrix won't send any keys unless it's connected to a key_collector.
Oh, you'd put at source_id
the btnmatrix id?
from esphome.
Yes. As with most things in esphome, if there's only one source, it will pick it up automatically, but otherwise, you need to specify the source id.
from esphome.
If the
btnmatrix
provides thekey_provider
interface, then it will work automatically.
Done. Works a treat.
from esphome.
Recipe ready for the Cookbook: https://deploy-preview-3510--esphome.netlify.app/cookbook/lvgl#a-numeric-input-keypad
from esphome.
Related Issues (20)
- Font kerning HOT 1
- Formatted text for widget updates HOT 1
- QR code
- Graph as image HOT 2
- VNC: host binary crashes on client disconnect
- VNC and `graphical_display_menu` don't play nicely together HOT 3
- Custom component/code integration for pages, widgets, etc. HOT 6
- Lvgl on e-paper crash (TTGO T5_V2.3_2.13) HOT 2
- Compile error in LVGL after last commit. HOT 6
- FR: `udp` sensor from multiple providers
- FR: `udp` text sensor
- FR: `udp` arbitrary data with actions and triggers HOT 1
- FR: `udp` repeat messages
- Page's `skip` option to be set at runtime
- FR: `udp` multiple instances HOT 2
- disp_bg_image error HOT 1
- Additional ST7701s initialization request HOT 6
- Import of SVG files not working correctly with LVGL HOT 4
- Arc is clickable outside of range HOT 1
- Raised issues in ESPHome issues HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from esphome.