ESPHome directly controls device 2 without going through HA device 1

Directory 1. Public configuration file 2. Equipment 2: Desk lamp 3.Controller (http.post) 4. Get status (http.get) 5. Extract Json data (`string` type) 6. Extract Json data (`int` type) `Attention` 1. Public configuration file #wifi.yaml wifi: networks: – ssid: “123” password: “www.123.com” – ssid: “456” password: “www.123.com” # When the specified wifi cannot be connected, enable […]

Nginx security controls HTTP and HTTPS

HTTP and HTTPS 1. HTTP (Hypertext Transfer Protocol) Function: Basic Protocol: HTTP is the basic protocol used to transmit web pages (HTML files) and other resources on the Internet. Features: Clear text transmission: The data transmitted by HTTP is unencrypted and anyone can capture and view the transmitted data. Stateless: The HTTP protocol itself does […]

WPF implements methods for exporting data in table controls to CSV files or other file types and importing the files

This example is mainly written based on the method of exporting the data source in the WPF DataGrid control to a CSV file and then importing the CSV file. If you need to export to other types, please change the export type in the code yourself. The specific implementation can be found according to the […]

[Qt controls QLineEdit, QPlainTextEdit, QTextEdit, QTextBrowser] usage and differences

Introduction QLineEdit, QPlainTextEdit, QTextEdit and QTextBrowser are all controls used for text input and display in Qt. There are some differences between them and they are suitable for different scenarios. The following is a brief introduction, differences and usage tips for these four categories: Function Name Function QLineEdit QLineEdit is a simple single-line text input […]

[Transfer] WPF custom controls and styles (9)-tree control TreeView and menu Menu-ContextMenu

one. Preface Disclaimer: WPF Custom Controls and Styles is a series of articles, which are somewhat related, but most of them are released gradually from simple to complex. The main content of this article: Custom style of menuMenu; Custom style of right-click menu ContextMenu; Custom style of tree control TreeView, and right-click menu implementation. two. […]

[Transfer] WPF custom controls and styles (10)-Progress control ProcessBar custom sample

one. Preface Disclaimer: WPF Custom Controls and Styles is a series of articles, which are somewhat related, but most of them are released gradually from simple to complex. The main content of this article: ProcessBar custom standard style; ProcessBar custom circular progress style; two. ProcessBar standard style Rendering: The style of ProcessBar is very simple: […]

PrinterJob controls printer print data

Here we mainly demonstrate the GK888CN printer package org.example; import com.alibaba.excel.EasyExcel; import com.google.zxing.BarcodeFormat; import com.google.zxing.EncodeHintType; import com.google.zxing.WriterException; import com.google.zxing.common.BitMatrix; import com.google.zxing.qrcode.QRCodeWriter; import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel; import org.springframework.util.StringUtils; import javax.print.*; import javax.print.attribute.DocAttributeSet; import javax.print.attribute.PrintRequestAttributeSet; import javax.swing.*; import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.image.BufferedImage; import java.awt.print.PageFormat; import java.awt.print.Paper; import java.awt.print.Printable; import java.awt.print.PrinterJob; import java.io.IOException; import java.util.HashMap; import java.util.List; […]

[Transfer] [C#] Hosting controls in Windows Forms DataGridView cells

using System; using System.Windows.Forms; public class CalendarColumn : DataGridViewColumn { public CalendarColumn() : base(new CalendarCell()) { } public override DataGridViewCell CellTemplate { get { return base.CellTemplate; } set { // Ensure that the cell used for the template is a CalendarCell. if (value != null & amp; & amp; !value.GetType().IsAssignableFrom(typeof(CalendarCell))) { throw new InvalidCastException(“Must be […]