ESPHome
2026.11.0-dev
Loading...
Searching...
No Matches
esphome
components
mt6701_spi
binary_sensor
mt6701_spi_binary_sensors.h
Go to the documentation of this file.
1
#pragma once
2
3
#include "
esphome/components/binary_sensor/binary_sensor.h
"
4
#include "
esphome/components/mt6701_spi/mt6701_spi.h
"
5
#include "
esphome/core/component.h
"
6
#include "
esphome/core/helpers.h
"
7
8
namespace
esphome::mt6701_spi
{
9
10
// Reads the encoder at its own interval and publishes the status flags of each frame
11
class
MT6701SPIBinarySensors
:
public
Component
,
public
Parented
<MT6701SPIComponent> {
12
SUB_BINARY_SENSOR(push_button)
13
SUB_BINARY_SENSOR(track_loss)
14
15
public
:
16
void
set_update_interval(
uint32_t
update_interval) { this->
update_interval_
= update_interval; }
17
void
loop()
override
;
18
void
dump_config()
override
;
19
20
protected
:
21
uint32_t
update_interval_
{50};
22
uint32_t
last_read_
{0};
23
};
24
25
}
// namespace esphome::mt6701_spi
binary_sensor.h
esphome::Component
Definition
component.h:147
esphome::Parented
Helper class to easily give an object a parent of type T.
Definition
helpers.h:2073
esphome::mt6701_spi::MT6701SPIBinarySensors
Definition
mt6701_spi_binary_sensors.h:11
esphome::mt6701_spi::MT6701SPIBinarySensors::update_interval_
uint32_t update_interval_
Definition
mt6701_spi_binary_sensors.h:21
esphome::mt6701_spi::MT6701SPIBinarySensors::last_read_
uint32_t last_read_
Definition
mt6701_spi_binary_sensors.h:22
component.h
helpers.h
mt6701_spi.h
esphome::mt6701_spi
Definition
mt6701_spi_binary_sensors.cpp:5
uint32_t
static void uint32_t
Definition
crash_handler.cpp:153
Generated by
1.12.0