Maurice Makaay
ec8205d32e
Added a binary sensor component, which can be used to handle touch/release events for the parts of the front panel (power button, color button and slider). Note that for the slider, this binary_sensor only detects the touch events. This cannot be used for detecting the actual slider level that was touch. For that purpose, a separate sensor will be created.
3 years ago
Maurice Makaay
6e2bb7b0c0
Front panel event code cleaned up and added an on event callback option, so I can let events propagate.
3 years ago
Maurice Makaay
b340ede5b3
Implemented the I2C messgage to event type parser.
3 years ago
Maurice Makaay
e5612e8235
What's better than one hub? Two HALs! I split up the HUB component into two separated components with the same kind of function: LightHAL and FrontPanelHAL.
3 years ago
Maurice Makaay
c161a12664
Added a light HAL to the hub component.
3 years ago
Maurice Makaay
8c2ab117e7
Fixed invalid config block in the example-full.yaml.
Thanks for the notice, @davorin .
3 years ago
Maurice Makaay
24f16c8a3a
Use espressif32 v3.2.0 + arduinoespressif32 1.0.6
3 years ago
Maurice Makaay
dd9143dfa9
Added a configuration example that includes all yeelight_bs2 component configuration options. Normally, you can fully omit this component from the device yaml configuration. It will implictly load working defaults.
3 years ago
Maurice Makaay
dcfe951307
Added the front panel I2CComponent to the hub component.
3 years ago
Maurice Makaay
6d83a2edd6
Updated the example configuration for the latest code.
3 years ago
Maurice Makaay
90fc42e141
Moved the last few light GPIO pins into the HUB comopnent.
3 years ago
Maurice Makaay
3d5a68d9c4
Merge branch 'main' of https://github.com/mmakaay/esphome-yeelight_bs2 into main
3 years ago
Maurice Makaay
e29968d86a
Introduced a HUB component + front panel IRQ handling
A HUB component was introduced. This HUB component has all the knowledge
about the Yeelight Bedside Lamp 2 hardware. It known what pins are used,
that PWM frequencies to use, what pins to switch in binary mode, etc. etc.
No configuration is required for this HUB component. It's automatically
loaded when the light component is loaded. The light component will use the
HUB component to access the pins that are required for driving the LED
circuitry.
Note that this simplifies the configuration by A LOT. There's no need
anymore to configure the pinouts in the YAML file. This is a logical route
to take, since we're talking about a factory-produced PCB with a soldered on
ESP32 chip, which uses the same GPIO's and settings on all produced devices
(I presume). It would be quite redundant to force every user into
configuring these pinouts themselves.
** Beware to update your device yaml configuration **
There are a few pinouts left to move into the HUB. I will do that in the
next commit. Your device yaml configuration can be simplified along with
these changes. Some of the keys in the existing light configuration block
will no longer work and will have to be removed (red, green, blue, white).
** Further development **
The HUB will be extended make it the central component that also handles
the I2C communication. This way, there is a central place to regulate the
traffic to and from the front panel. We will be able to build upon this
by implementing extra, fully separated components that handle for example
the front panel light level, the power button, the color button and
the slider.
** Interrupt handler for the I2C IRQ trigger pin **
One requirement for the I2C communication has already been implemented: an
interrupt handler for the GPIO that is used by the front panel to signal the
ESP that a new touch or release event is avilable to be read.
It doens't do anything functionally right now, but if you watch the log
file, you will see that touch events are detected and that they trigger some
log messages.
3 years ago
Maurice Makaay
8c7ccfb995
Merge pull request #3 from tabacha/docu-url-fix
Docu url fix copy soldering points jpeg to github
3 years ago
Sven Anders
8a0245a2e3
Use Soldering_points.jpeg from repo not from home-assistant forum
3 years ago
Sumrf from the homeassistant forum
71395dc567
Add Soldering Points photo
3 years ago
Maurice Makaay
9edea79ff7
Fixed error when using light ID in an automation
"ID 'bedlight' of type yeelight::bs2::YeelightBS2LightState doesn't inherit
from light::LightState. Please double check your ID is pointing to the
correct value."
3 years ago
Maurice Makaay
7c3ee035d8
Update FLASHING.md
A few updates to the flashing docs.
3 years ago
Maurice Makaay
4410d1475a
Added on_brightness automation trigger to the light output.
3 years ago
Maurice Makaay
edcadc146c
Moved the finished light component into its own subdirectory to keep things clean when implementing other components.
3 years ago
Maurice Makaay
6c56a3e973
Documentation updates.
3 years ago
Maurice Makaay
18706557c5
Replaced all interpolation code with esphome::lerp().
3 years ago
Maurice Makaay
46e4b69c7c
Another round of code cleanup. Almost done, one more pass and I'm good to continue with the next task: the touch panel.
3 years ago
Maurice Makaay
7b198eab1d
Some calibration on the RGB night light settings.
3 years ago
Maurice Makaay
4e323c76ff
A round of code cleanup.
3 years ago
Maurice Makaay
c0507e642b
In RGB mode, brightness level 1 now triggers a night light mode that actually uses the RGB settings. So this makes it possible to have a night light in a specific color, instead of only the default night light setting. In white light mode, this default is used, so color temperature does not affect the night light color.
3 years ago
Maurice Makaay
7a147072a8
Fixed transitioning behavior when a new transitioning is started to the same end color of a transitioning that is already in progress (can be triggered from Home Assistant by double clicking on a target color in the RGB color circle).
3 years ago
Maurice Makaay
fe3fd69052
Update FLASHING.md
Added missing GPIO0 reference to the soldering section.
3 years ago
Maurice Makaay
956660c2bf
Added some extra information to the FLASHING.md document.
3 years ago
Maurice Makaay
e9af4a9614
Fixed the transitioning flow in cass where an already active transition gets interrupted by a new transition with a different end point.
3 years ago
Maurice Makaay
1325ef62cf
Make use of smoothed progress for color transitionings.
3 years ago
Maurice Makaay
abe8137b42
Transitioning to off works too now. Transitioning to on needs some more work (it is now instant, but that won't be hard to implement correctly).
3 years ago
Maurice Makaay
bb91890389
New light transition code implemented and it works beautifully! Transitions between RGB colors and RGB to and from white light now look smooth. Some more code cleanup in the next step, but already loving how this is coming together now.
3 years ago
Maurice Makaay
e8ae6a9765
Some code cleanup as preparation for the next bits of development for transition handling.
3 years ago
Maurice Makaay
4032b14bcb
Added development warning to README.md.
3 years ago
Maurice Makaay
47bb1469fc
Finally going somewhere with the transitioning implementation. The basic framework for the latest ideas is up and running. Now implement the actual transitioning logic.
3 years ago
Maurice Makaay
92d935b0b4
Experimental class structure to give my LightOutput class access to some protected data in the LightState class.
3 years ago
Maurice Makaay
d330894fdc
Started my own derived LightState class to get more control over the light's transitioning behavior.
3 years ago
Maurice Makaay
9fa8aa42ff
Switch to night light mode at low brightness in both white light and RGB mode.
3 years ago
Maurice Makaay
a56cbcc6d2
Transition time to 750ms in the example.yaml. This makes the color transitions look a bit smoother than when using 1s.
3 years ago
Maurice Makaay
a860ea9921
Removed old stale RGB code.
3 years ago
Maurice Makaay
0b373526da
Code cleanup on RGB code + RGB #FFFFFF implementation added.
3 years ago
Maurice Makaay
9c102d7c81
Moved reverse engineer docs to own repo.
3 years ago
Maurice Makaay
49404b083d
Ledc PWM frequency issues are fixed
Setting the PWM channels and frequencies is now done fully from
the device yaml configuration file, so I removed the frequency
code from the CPP code.
3 years ago
Maurice Makaay
dec3454f37
Updated the example.yaml file with some documentation and a fix for PWM frequency issues that I ran into.
3 years ago
Maurice Makaay
efee6efba4
Merge pull request #1 from tabacha/flashing-doc
Flashing doc
3 years ago
Sven Anders
bd7980a7fb
Add first flashing doc
3 years ago
Sven Anders
2b88067c2d
Add some example wifi config to example.yml
3 years ago
Maurice Makaay
b960a5bee9
New implementation for RGB colors. It needs a round of code cleanup, but it is functional as-is.
3 years ago
Maurice Makaay
173cc2f5c2
Merge branch 'main' of https://github.com/mmakaay/esphome-yeelight_bs1 into main
3 years ago