Skip to content

Commit

Permalink
ArduinoHA 2.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dawidchyrzynski committed Feb 9, 2024
2 parents 0fc32a5 + 2a00dcd commit 1d333ab
Show file tree
Hide file tree
Showing 128 changed files with 2,276 additions and 297 deletions.
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github: dawidchyrzynski
31 changes: 28 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,30 @@
# Changelog

## 2.1.0

**New features:**
* Added support for setting MQTT's keep alive [#153](https://github.com/dawidchyrzynski/arduino-home-assistant/issues/153) by [@allenb2800](https://github.com/allenb2800)
* Added support for the `state_class` property in the `HASensor` [#179](https://github.com/dawidchyrzynski/arduino-home-assistant/pull/179)
* Implemented extended unique ID support for all device types. This allows you to prefix each device type's unique ID with the device ID, ensuring smooth deployment of identical code on multiple devices without encountering unique ID conflicts [#212](https://github.com/dawidchyrzynski/arduino-home-assistant/issues/212)
* Added support for the `configuration_url` property in the `HADevice` [#182](https://github.com/dawidchyrzynski/arduino-home-assistant/issues/182)
* Added `getCurrentOption` method to the `HASelect` device type [#163](https://github.com/dawidchyrzynski/arduino-home-assistant/issues/163)
* Added support for publishing the `None` state in the `HASelect` device type [#146](https://github.com/dawidchyrzynski/arduino-home-assistant/issues/146)
* Added support for publishing the `None` state in the `HASensor` device type [#175](https://github.com/dawidchyrzynski/arduino-home-assistant/issues/175)
* Added support for the `expire_after` property in the `HASensor` [#171](https://github.com/dawidchyrzynski/arduino-home-assistant/issues/171)
* Added support for the `expire_after` property in the `HABinarySensor` [#159](https://github.com/dawidchyrzynski/arduino-home-assistant/issues/159)
* Added support for the JSON attributes in the `HASensor`
* Added support for the `object_id` property in all device types
* Added `setBufferSize` method to the `HAMqtt` class [#202](https://github.com/dawidchyrzynski/arduino-home-assistant/issues/202)
* Added `getState` method to the `HAMqtt` class
* Added `onDisconnected` callback method to the `HAMqtt` class
* Added `onStateChanged` callback method to the `HAMqtt` class
* Added support for Arduino Due [#137](https://github.com/dawidchyrzynski/arduino-home-assistant/issues/137)

**Fixes:**
* Fixed a bug with the maximum number of device types [#190](https://github.com/dawidchyrzynski/arduino-home-assistant/issues/190) by [@martaisty](https://github.com/martaisty)
* Fixed compiler warning: `class 'HANumeric' is implicitly friends with itself` [#197](https://github.com/dawidchyrzynski/arduino-home-assistant/pull/197) by [@shedokan](https://github.com/shedokan)
* The default limit for device types has been raised to 24 on processors other than ATMega328/ATMega168. The previous default limit of 6 led to confusion for many users.

## 2.0.0

**New features:**
Expand All @@ -24,12 +49,12 @@
* Added support for the `HAScene` device type
* Added support for the `HALight` device type

**Bugs fixes:**
**Fixes:**
* Last Will Message is now retained (#70)
* Compilation error on SAMD family (#82)

**New examples:**
* [Button](examples/button/button.ino) - adding simple buttons to the Home Assistant panel.
**New examples:**
* [Button](examples/button/button.ino) - adding simple buttons to the Home Assistant panel.

**Breaking changes:**

Expand Down
16 changes: 14 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
# Arduino Home Assistant integration 🏠

[![](https://img.shields.io/github/v/release/dawidchyrzynski/arduino-home-assistant?label=Version)](https://github.com/dawidchyrzynski/arduino-home-assistant/releases)
[![](https://img.shields.io/badge/Browse_Documentation-40BC13)](https://dawidchyrzynski.github.io/arduino-home-assistant/)
[![](https://img.shields.io/static/v1?label=Sponsor&message=%E2%9D%A4&logo=GitHub&color=%23fe8e86)](https://github.com/sponsors/dawidchyrzynski)

ArduinoHA allows to integrate an Arduino/ESP based device with Home Assistant using MQTT.
The library is designed to use as low resources (RAM/flash) as possible.
Initially, it was optimized to work on Arduino Uno with Ethernet Shield,
but I successfully use it on ESP8266/ESP8255 boards in my projects.

[📘 Documentation](https://dawidchyrzynski.github.io/arduino-home-assistant/)

## Features

* Two-way communication (state reporting and command execution)
Expand All @@ -22,24 +24,33 @@ but I successfully use it on ESP8266/ESP8255 boards in my projects.

| Home Assistant type | Supported |
| ------------------- | :--------: |
| Alarm control panel ||
| Binary sensor ||
| Button ||
| Camera ||
| Cover ||
| Device tracker ||
| Device trigger ||
| Event ||
| Fan ||
| Humidifier ||
| Image ||
| HVAC ||
| Lawn mower ||
| Light ||
| Lock ||
| Number ||
| Scene ||
| Select ||
| Sensor ||
| Siren ||
| Switch ||
| Update ||
| Tag scanner ||
| Text ||
| Vacuum ||
| Valve ||
| Water heater ||

## Examples

Expand Down Expand Up @@ -83,6 +94,7 @@ Here is the list of devices on which the library was tested:
* Arduino Nano
* Arduino Pro Mini
* Arduino Nano 33 IoT
* Arduino Due
* NodeMCU
* Controllino Mega (Pure)
* Controllino Maxi (Pure)
Expand Down
4 changes: 4 additions & 0 deletions docs/_static/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ table.examples-table tbody td + td {
.searchbox .caption-text {
display: none
}
.code-block-caption {
margin-top: 30px;
font-weight: bold;
}
form {
display: flex;
flex-direction: row;
Expand Down
2 changes: 1 addition & 1 deletion docs/_static/documentation_options.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var DOCUMENTATION_OPTIONS = {
URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'),
VERSION: '2.0.0',
VERSION: '2.1.0',
LANGUAGE: 'None',
COLLAPSE_INDEX: false,
BUILDER: 'html',
Expand Down
32 changes: 31 additions & 1 deletion docs/documents/api/core/ha-device.html
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
<li class="toctree-l2"><a class="reference internal" href="../../library/availability-reporting.html">Availability reporting</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../library/connection-params.html">Connection parameters</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../library/discovery.html">Discovery</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../library/device-types.html">Device types</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../library/device-types.html">Device types (entities)</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../library/mqtt-security.html">MQTT security</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../library/mqtt-advanced.html">MQTT advanced features</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../library/compiler-macros.html">Compiler macros</a></li>
Expand All @@ -114,6 +114,7 @@
<li class="toctree-l2"><a class="reference internal" href="../utils/index.html">Utils API</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference external" href="https://github.com/sponsors/dawidchyrzynski">Sponsor</a></li>
</ul>

</div>
Expand Down Expand Up @@ -215,6 +216,12 @@ <h1>HADevice class<a class="headerlink" href="#hadevice-class" title="Permalink
<dd><p>Returns true if the shared availability is enabled for the device. </p>
</dd></dl>

<dl class="cpp function">
<dt class="sig sig-object cpp" id="_CPPv4NK8HADevice26isExtendedUniqueIdsEnabledEv">
<span id="_CPPv3NK8HADevice26isExtendedUniqueIdsEnabledEv"></span><span id="_CPPv2NK8HADevice26isExtendedUniqueIdsEnabledEv"></span><span id="HADevice::isExtendedUniqueIdsEnabledC"></span><span class="target" id="class_h_a_device_1ad7e1673506833aa7072b4b604b20ecda"></span><span class="k"><span class="pre">inline</span></span><span class="w"> </span><span class="kt"><span class="pre">bool</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">isExtendedUniqueIdsEnabled</span></span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><span class="w"> </span><span class="k"><span class="pre">const</span></span><a class="headerlink" href="#_CPPv4NK8HADevice26isExtendedUniqueIdsEnabledEv" title="Permalink to this definition"></a><br /></dt>
<dd><p>Returns true if the extended unique IDs feature is enabled for the device. </p>
</dd></dl>

<dl class="cpp function">
<dt class="sig sig-object cpp" id="_CPPv4NK8HADevice20getAvailabilityTopicEv">
<span id="_CPPv3NK8HADevice20getAvailabilityTopicEv"></span><span id="_CPPv2NK8HADevice20getAvailabilityTopicEv"></span><span id="HADevice::getAvailabilityTopicC"></span><span class="target" id="class_h_a_device_1ab508af42eb1fc0573a89afa3b92645fe"></span><span class="k"><span class="pre">inline</span></span><span class="w"> </span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">getAvailabilityTopic</span></span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><span class="w"> </span><span class="k"><span class="pre">const</span></span><a class="headerlink" href="#_CPPv4NK8HADevice20getAvailabilityTopicEv" title="Permalink to this definition"></a><br /></dt>
Expand All @@ -227,6 +234,12 @@ <h1>HADevice class<a class="headerlink" href="#hadevice-class" title="Permalink
<dd><p>Returns online/offline state of the device. </p>
</dd></dl>

<dl class="cpp function">
<dt class="sig sig-object cpp" id="_CPPv4N8HADevice23enableExtendedUniqueIdsEv">
<span id="_CPPv3N8HADevice23enableExtendedUniqueIdsEv"></span><span id="_CPPv2N8HADevice23enableExtendedUniqueIdsEv"></span><span id="HADevice::enableExtendedUniqueIds"></span><span class="target" id="class_h_a_device_1ad5634185083f02113ea68a357c16d228"></span><span class="k"><span class="pre">inline</span></span><span class="w"> </span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">enableExtendedUniqueIds</span></span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv4N8HADevice23enableExtendedUniqueIdsEv" title="Permalink to this definition"></a><br /></dt>
<dd><p>Enables the use of extended unique IDs for all registered device types. The unique ID of each device type will be prefixed with the device’s ID once enabled. </p>
</dd></dl>

<dl class="cpp function">
<dt class="sig sig-object cpp" id="_CPPv4N8HADevice11setUniqueIdEPK4byteK8uint16_t">
<span id="_CPPv3N8HADevice11setUniqueIdEPK4byteK8uint16_t"></span><span id="_CPPv2N8HADevice11setUniqueIdEPK4byteK8uint16_t"></span><span id="HADevice::setUniqueId__byteCP.uint16_tC"></span><span class="target" id="class_h_a_device_1a8d10a57aa14007643ccdecd7c1a372a5"></span><span class="kt"><span class="pre">bool</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">setUniqueId</span></span></span><span class="sig-paren">(</span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="n"><span class="pre">byte</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n sig-param"><span class="pre">uniqueId</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="n"><span class="pre">uint16_t</span></span><span class="w"> </span><span class="n sig-param"><span class="pre">length</span></span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv4N8HADevice11setUniqueIdEPK4byteK8uint16_t" title="Permalink to this definition"></a><br /></dt>
Expand Down Expand Up @@ -289,6 +302,17 @@ <h1>HADevice class<a class="headerlink" href="#hadevice-class" title="Permalink
</dl>
</dd></dl>

<dl class="cpp function">
<dt class="sig sig-object cpp" id="_CPPv4N8HADevice19setConfigurationUrlEPKc">
<span id="_CPPv3N8HADevice19setConfigurationUrlEPKc"></span><span id="_CPPv2N8HADevice19setConfigurationUrlEPKc"></span><span id="HADevice::setConfigurationUrl__cCP"></span><span class="target" id="class_h_a_device_1a70cd536783b2b994e9d903d6daa30f44"></span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">setConfigurationUrl</span></span></span><span class="sig-paren">(</span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n sig-param"><span class="pre">url</span></span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv4N8HADevice19setConfigurationUrlEPKc" title="Permalink to this definition"></a><br /></dt>
<dd><p>Sets the “configuration URL” property that’s going to be used by the Home Assistant.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>url</strong> – Configuration URL to publish. </p>
</dd>
</dl>
</dd></dl>

<dl class="cpp function">
<dt class="sig sig-object cpp" id="_CPPv4N8HADevice15setAvailabilityEb">
<span id="_CPPv3N8HADevice15setAvailabilityEb"></span><span id="_CPPv2N8HADevice15setAvailabilityEb"></span><span id="HADevice::setAvailability__b"></span><span class="target" id="class_h_a_device_1a3eac570f51a76789f0564714166c674a"></span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">setAvailability</span></span></span><span class="sig-paren">(</span><span class="kt"><span class="pre">bool</span></span><span class="w"> </span><span class="n sig-param"><span class="pre">online</span></span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv4N8HADevice15setAvailabilityEb" title="Permalink to this definition"></a><br /></dt>
Expand Down Expand Up @@ -357,6 +381,12 @@ <h1>HADevice class<a class="headerlink" href="#hadevice-class" title="Permalink
<dd><p>Specifies whether the device is available (online / offline). </p>
</dd></dl>

<dl class="cpp var">
<dt class="sig sig-object cpp" id="_CPPv4N8HADevice18_extendedUniqueIdsE">
<span id="_CPPv3N8HADevice18_extendedUniqueIdsE"></span><span id="_CPPv2N8HADevice18_extendedUniqueIdsE"></span><span id="HADevice::_extendedUniqueIds__b"></span><span class="target" id="class_h_a_device_1ad330d3098dd3741669b09c6e98fa8a2c"></span><span class="kt"><span class="pre">bool</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">_extendedUniqueIds</span></span></span><a class="headerlink" href="#_CPPv4N8HADevice18_extendedUniqueIdsE" title="Permalink to this definition"></a><br /></dt>
<dd><p>Specifies whether extended unique IDs feature is enabled. </p>
</dd></dl>

</div>
</dd></dl>

Expand Down
Loading

0 comments on commit 1d333ab

Please sign in to comment.