mirror of
https://github.com/esphome/esphome.git
synced 2024-12-02 19:54:14 +01:00
8e75980ebd
* Cleanup dashboard JS * Add vscode * Save start_mark/end_mark * Updates * Updates * Remove need for cv.nameable It's a bit hacky but removes so much bloat from integrations * Add enum helper * Document APIs, and Improvements * Fixes * Fixes * Update PULL_REQUEST_TEMPLATE.md * Updates * Updates * Updates
21 lines
626 B
C++
21 lines
626 B
C++
#pragma once
|
|
|
|
#include "esphome/core/component.h"
|
|
#include "esphome/core/helpers.h"
|
|
#include "esphome/components/sensor/sensor.h"
|
|
#include "esphome/components/wifi/wifi_component.h"
|
|
|
|
namespace esphome {
|
|
namespace wifi_signal {
|
|
|
|
class WiFiSignalSensor : public sensor::Sensor, public PollingComponent {
|
|
public:
|
|
void update() override { this->publish_state(WiFi.RSSI()); }
|
|
void dump_config() override;
|
|
|
|
std::string unique_id() override { return get_mac_address() + "-wifisignal"; }
|
|
float get_setup_priority() const override { return setup_priority::AFTER_WIFI; }
|
|
};
|
|
|
|
} // namespace wifi_signal
|
|
} // namespace esphome
|