Skip to content

Commit

Permalink
Fix publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
lanwin committed Feb 8, 2024
1 parent 1ce703d commit 7083c9b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions components/samsung_ac/protocol_nasa.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,8 @@ namespace esphome

ESP_LOGW(TAG, "publish packet %s", packet.to_string().c_str());

out.push_back(packet);

auto data = packet.encode();
target->publish_data(data);
}
Expand Down
8 changes: 4 additions & 4 deletions components/samsung_ac/samsung_ac_device.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ namespace esphome
class Samsung_AC_Device
{
public:
Samsung_AC_Device(const std::string &address, Samsung_AC *samsung_ac)
Samsung_AC_Device(const std::string &address, MessageTarget *target)
{
this->address = address;
this->samsung_ac = samsung_ac;
this->target = target;
this->protocol = get_protocol(address);
}

Expand Down Expand Up @@ -247,12 +247,12 @@ namespace esphome

void publish_request(ProtocolRequest &request)
{
protocol->publish_request((MessageTarget *)samsung_ac, address, request);
protocol->publish_request(target, address, request);
}

protected:
Protocol *protocol{nullptr};
Samsung_AC *samsung_ac{nullptr};
MessageTarget *target{nullptr};

void calc_and_publish_mode()
{
Expand Down

0 comments on commit 7083c9b

Please sign in to comment.