Skip to content
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

update 2023.12 #1

Merged
merged 1 commit into from
Jan 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion components/obegraensad_panel/display.py
Original file line number Diff line number Diff line change
@@ -7,6 +7,7 @@
CONF_PAGES,
CONF_CONTRAST,
)
from esphome.const import __version__ as ESPHOME_VERSION

DEPENDENCIES = []

@@ -38,7 +39,8 @@
async def to_code(config):
var = cg.new_Pvariable(config[CONF_ID])

await cg.register_component(var, config)
if cv.Version.parse(ESPHOME_VERSION) < cv.Version.parse("2023.12.0"):
await cg.register_component(var, config)
await display.register_display(var, config)

cg.add(var.set_pins(
11 changes: 8 additions & 3 deletions components/obegraensad_panel/obegraensad-panel.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#pragma once

#include "esphome/core/defines.h"
#include "esphome/core/version.h"
#include "esphome/core/component.h"
#include "esphome/components/display/display_buffer.h"

@@ -9,8 +11,11 @@
namespace esphome {
namespace obegraensadpanel {

class Panel : public PollingComponent,
public display::DisplayBuffer {
#if ESPHOME_VERSION_CODE >= VERSION_CODE(2023, 12, 0)
class Panel : public display::DisplayBuffer {
#else
class Panel : public PollingComponent, public display::DisplayBuffer {
#endif // VERSION_CODE(2023, 12, 0)
public:
int p_latch;
int p_clock;
@@ -23,7 +28,7 @@ class Panel : public PollingComponent,
}

float get_setup_priority() const override { return setup_priority::PROCESSOR; }

display::DisplayType get_display_type() override { return display::DisplayType::DISPLAY_TYPE_BINARY; }

void data(uint8_t value);