Skip to content

Commit

Permalink
Revert desk_height_sensor.cpp changes
Browse files Browse the repository at this point in the history
  • Loading branch information
iMicknl committed Jun 8, 2024
1 parent 4f82920 commit f3da259
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions components/loctekmotion_desk_height/desk_height_sensor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,14 @@
#include "esphome/core/helpers.h"
#include "esphome/core/log.h"
#include <bitset>
#include <cstdint>

namespace esphome {
namespace loctekmotion_desk_height {

static const char *const TAG = "loctekmotion_desk_height.sensor";

// ========== UTILITY METHODS ==========

int hex_to_int(std::uint8_t s) {
int hex_to_int(byte s) {
std::bitset<8> b(s);

if (b[0] && b[1] && b[2] && b[3] && b[4] && b[5] && !b[6]) {
Expand Down Expand Up @@ -50,12 +48,12 @@ int hex_to_int(std::uint8_t s) {
return 0;
}

bool is_decimal(std::uint8_t b) { return (b & 0x80) == 0x80; }
bool is_decimal(byte b) { return (b & 0x80) == 0x80; }

// ========== INTERNAL METHODS ==========
void DeskHeightSensor::loop() {
while (this->available() > 0) {
std::uint8_t incomingByte = this->read();
byte incomingByte = this->read();
// ESP_LOGD("DEBUG", "Incoming byte is: %08x", incomingByte);

// First byte, start of a packet
Expand Down

0 comments on commit f3da259

Please sign in to comment.