From 5263d1fdd250416183c65e5a08bff77486d350ad Mon Sep 17 00:00:00 2001 From: Brian Hanifin Date: Thu, 18 Apr 2019 10:25:54 -0700 Subject: [PATCH 1/8] initial integration migration New integrations info: http://bit.ly/2KQl1xZ --- custom_components.json | 13 +++++++++++++ custom_components/rainforest_emu2/__init__.py | 0 custom_components/rainforest_emu2/manifest.json | 8 ++++++++ .../{sensor => rainforest_emu2}/readme.md | 2 +- .../{sensor/emu2.py => rainforest_emu2/sensor.py} | 2 +- 5 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 custom_components.json create mode 100644 custom_components/rainforest_emu2/__init__.py create mode 100644 custom_components/rainforest_emu2/manifest.json rename custom_components/{sensor => rainforest_emu2}/readme.md (92%) rename custom_components/{sensor/emu2.py => rainforest_emu2/sensor.py} (98%) diff --git a/custom_components.json b/custom_components.json new file mode 100644 index 0000000..f59a76b --- /dev/null +++ b/custom_components.json @@ -0,0 +1,13 @@ +{ + "rainforest_emu2": { + "version": "0.2.0", + "local_location": "/custom_components/rainforest_emu2/__init__.py", + "remote_location": "https://raw.githubusercontent.com/jrhorrisberger/home-assistant/master/custom_components/rainforest_emu2/__init__.py", + "visit_repo": "https://github.com/jrhorrisberger/home-assistant", + "changelog": "https://github.com/jrhorrisberger/home-assistant/wiki/Changelog", + "resources": [ + "https://raw.githubusercontent.com/jrhorrisberger/home-assistant/master/custom_components/rainforest_emu2/__init__.py", + "https://raw.githubusercontent.com/jrhorrisberger/home-assistant/master/custom_components/rainforest_emu2/sensor.py" + ] + } +} \ No newline at end of file diff --git a/custom_components/rainforest_emu2/__init__.py b/custom_components/rainforest_emu2/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/custom_components/rainforest_emu2/manifest.json b/custom_components/rainforest_emu2/manifest.json new file mode 100644 index 0000000..3bceb4c --- /dev/null +++ b/custom_components/rainforest_emu2/manifest.json @@ -0,0 +1,8 @@ +{ + "domain": "rainforest_emu2", + "name": "Rainforest EMU-2", + "documentation": "https://github.com/jrhorrisberger/home-assistant/custom_components/rainforest_emu2", + "dependencies": [], + "codeowners": ["@jrhorrisberger"], + "requirements": [] + } \ No newline at end of file diff --git a/custom_components/sensor/readme.md b/custom_components/rainforest_emu2/readme.md similarity index 92% rename from custom_components/sensor/readme.md rename to custom_components/rainforest_emu2/readme.md index 56e2851..f984667 100644 --- a/custom_components/sensor/readme.md +++ b/custom_components/rainforest_emu2/readme.md @@ -1,5 +1,5 @@ # EMU2 Meter Component -Place `emu2.py` in `config\custom_components\sensor\` +Place `sensor.py` in `config\custom_components\rainforest_emu2\` ## Overview To use your Rainforest Automation EMU-2™ Energy Monitoring Unit in your installation, add the following to your `configuration.yaml` file: diff --git a/custom_components/sensor/emu2.py b/custom_components/rainforest_emu2/sensor.py similarity index 98% rename from custom_components/sensor/emu2.py rename to custom_components/rainforest_emu2/sensor.py index 9b583e2..3ce101d 100644 --- a/custom_components/sensor/emu2.py +++ b/custom_components/rainforest_emu2/sensor.py @@ -1,7 +1,7 @@ """ Use serial protocol of EMU2 meter to obtain state of the connected meter. For more details about this component, please refer to the documentation -at https://home-assistant.io/components/sensor.emu2/ +at https://github.com/jrhorrisberger/home-assistant/custom_components/rainforest_emu2 """ from homeassistant.helpers.entity import Entity From 1f0259e117a9d830dc156305299ecbb809e3e5a2 Mon Sep 17 00:00:00 2001 From: Brian Hanifin Date: Thu, 18 Apr 2019 10:55:55 -0700 Subject: [PATCH 2/8] platform rename I believe renaming emu2 - rainforest more closely matches the existing HA naming standard. (Unless they have more products than energy monitors, then perhaps rainforest_energy?) --- custom_components.json | 10 +++++----- .../{rainforest_emu2 => rainforest}/__init__.py | 0 .../{rainforest_emu2 => rainforest}/manifest.json | 6 +++--- .../{rainforest_emu2 => rainforest}/readme.md | 6 +++--- .../{rainforest_emu2 => rainforest}/sensor.py | 4 ++-- 5 files changed, 13 insertions(+), 13 deletions(-) rename custom_components/{rainforest_emu2 => rainforest}/__init__.py (100%) rename custom_components/{rainforest_emu2 => rainforest}/manifest.json (58%) rename custom_components/{rainforest_emu2 => rainforest}/readme.md (85%) rename custom_components/{rainforest_emu2 => rainforest}/sensor.py (98%) diff --git a/custom_components.json b/custom_components.json index f59a76b..2edc6d4 100644 --- a/custom_components.json +++ b/custom_components.json @@ -1,13 +1,13 @@ { - "rainforest_emu2": { + "rainforest": { "version": "0.2.0", - "local_location": "/custom_components/rainforest_emu2/__init__.py", - "remote_location": "https://raw.githubusercontent.com/jrhorrisberger/home-assistant/master/custom_components/rainforest_emu2/__init__.py", + "local_location": "/custom_components/rainforest/__init__.py", + "remote_location": "https://raw.githubusercontent.com/jrhorrisberger/home-assistant/master/custom_components/rainforest/__init__.py", "visit_repo": "https://github.com/jrhorrisberger/home-assistant", "changelog": "https://github.com/jrhorrisberger/home-assistant/wiki/Changelog", "resources": [ - "https://raw.githubusercontent.com/jrhorrisberger/home-assistant/master/custom_components/rainforest_emu2/__init__.py", - "https://raw.githubusercontent.com/jrhorrisberger/home-assistant/master/custom_components/rainforest_emu2/sensor.py" + "https://raw.githubusercontent.com/jrhorrisberger/home-assistant/master/custom_components/rainforest/__init__.py", + "https://raw.githubusercontent.com/jrhorrisberger/home-assistant/master/custom_components/rainforest/sensor.py" ] } } \ No newline at end of file diff --git a/custom_components/rainforest_emu2/__init__.py b/custom_components/rainforest/__init__.py similarity index 100% rename from custom_components/rainforest_emu2/__init__.py rename to custom_components/rainforest/__init__.py diff --git a/custom_components/rainforest_emu2/manifest.json b/custom_components/rainforest/manifest.json similarity index 58% rename from custom_components/rainforest_emu2/manifest.json rename to custom_components/rainforest/manifest.json index 3bceb4c..3b88f7a 100644 --- a/custom_components/rainforest_emu2/manifest.json +++ b/custom_components/rainforest/manifest.json @@ -1,7 +1,7 @@ { - "domain": "rainforest_emu2", - "name": "Rainforest EMU-2", - "documentation": "https://github.com/jrhorrisberger/home-assistant/custom_components/rainforest_emu2", + "domain": "rainforest", + "name": "Rainforest", + "documentation": "https://github.com/jrhorrisberger/home-assistant/custom_components/rainforest", "dependencies": [], "codeowners": ["@jrhorrisberger"], "requirements": [] diff --git a/custom_components/rainforest_emu2/readme.md b/custom_components/rainforest/readme.md similarity index 85% rename from custom_components/rainforest_emu2/readme.md rename to custom_components/rainforest/readme.md index f984667..03f06cd 100644 --- a/custom_components/rainforest_emu2/readme.md +++ b/custom_components/rainforest/readme.md @@ -1,5 +1,5 @@ -# EMU2 Meter Component -Place `sensor.py` in `config\custom_components\rainforest_emu2\` +# Install the Rainforest Component +Place `__init__.py` and `sensor.py` in `config\custom_components\rainforest\` ## Overview To use your Rainforest Automation EMU-2™ Energy Monitoring Unit in your installation, add the following to your `configuration.yaml` file: @@ -7,7 +7,7 @@ To use your Rainforest Automation EMU-2™ Energy Monitoring Unit in your instal ```yaml # Example configuration.yaml entry sensor: - - platform: emu2 + - platform: rainforest port: '/dev/ttyACM0' ``` diff --git a/custom_components/rainforest_emu2/sensor.py b/custom_components/rainforest/sensor.py similarity index 98% rename from custom_components/rainforest_emu2/sensor.py rename to custom_components/rainforest/sensor.py index 3ce101d..9431544 100644 --- a/custom_components/rainforest_emu2/sensor.py +++ b/custom_components/rainforest/sensor.py @@ -17,9 +17,9 @@ _LOGGER = logging.getLogger(__name__) -DOMAIN = "emu2" +DOMAIN = "rainforest" -DEFAULT_NAME = "EMU2 Instantaneous Power" +DEFAULT_NAME = "Rainforest Energy Monitoring Unit" CONF_PORT = 'port' ATTR_DEVICE_MAC_ID = "Device MAC ID" From b04c7510669585deda963fd3ce5e467c1477c7e8 Mon Sep 17 00:00:00 2001 From: Brian Hanifin Date: Thu, 18 Apr 2019 16:13:42 -0700 Subject: [PATCH 3/8] minor updates --- custom_components/rainforest/__init__.py | 1 + custom_components/rainforest/manifest.json | 14 +++++++------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/custom_components/rainforest/__init__.py b/custom_components/rainforest/__init__.py index e69de29..eb3ea36 100644 --- a/custom_components/rainforest/__init__.py +++ b/custom_components/rainforest/__init__.py @@ -0,0 +1 @@ +"""Support for the Rainforest Automation Energy Monitoring Unit.""" \ No newline at end of file diff --git a/custom_components/rainforest/manifest.json b/custom_components/rainforest/manifest.json index 3b88f7a..2117e5e 100644 --- a/custom_components/rainforest/manifest.json +++ b/custom_components/rainforest/manifest.json @@ -1,8 +1,8 @@ { - "domain": "rainforest", - "name": "Rainforest", - "documentation": "https://github.com/jrhorrisberger/home-assistant/custom_components/rainforest", - "dependencies": [], - "codeowners": ["@jrhorrisberger"], - "requirements": [] - } \ No newline at end of file + "domain": "rainforest", + "name": "Rainforest", + "documentation": "https://github.com/jrhorrisberger/home-assistant/custom_components/rainforest/readme.md", + "dependencies": [], + "codeowners": ["@jrhorrisberger"], + "requirements": [] +} \ No newline at end of file From e137c34a0fe4ec1bf66801b928c58495915ac6ec Mon Sep 17 00:00:00 2001 From: Brian Hanifin Date: Fri, 19 Apr 2019 11:27:51 -0700 Subject: [PATCH 4/8] more compliances updates --- custom_components.json | 9 +++++---- custom_components/rainforest/readme.md | 2 +- custom_components/rainforest/sensor.py | 6 +++--- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/custom_components.json b/custom_components.json index 2edc6d4..92f2c81 100644 --- a/custom_components.json +++ b/custom_components.json @@ -1,12 +1,13 @@ { "rainforest": { "version": "0.2.0", - "local_location": "/custom_components/rainforest/__init__.py", - "remote_location": "https://raw.githubusercontent.com/jrhorrisberger/home-assistant/master/custom_components/rainforest/__init__.py", - "visit_repo": "https://github.com/jrhorrisberger/home-assistant", - "changelog": "https://github.com/jrhorrisberger/home-assistant/wiki/Changelog", + "local_location": "/custom_components/rainforest/sensor.py", + "remote_location": "https://raw.githubusercontent.com/jrhorrisberger/home-assistant/master/custom_components/rainforest/sensor.py", + "visit_repo": "https://github.com/jrhorrisberger/home-assistant/custom_components/rainforest/", + "changelog": "https://github.com/jrhorrisberger/home-assistant/custom_components/rainforest/", "resources": [ "https://raw.githubusercontent.com/jrhorrisberger/home-assistant/master/custom_components/rainforest/__init__.py", + "https://raw.githubusercontent.com/jrhorrisberger/home-assistant/master/custom_components/rainforest/manifest.json", "https://raw.githubusercontent.com/jrhorrisberger/home-assistant/master/custom_components/rainforest/sensor.py" ] } diff --git a/custom_components/rainforest/readme.md b/custom_components/rainforest/readme.md index 03f06cd..243502d 100644 --- a/custom_components/rainforest/readme.md +++ b/custom_components/rainforest/readme.md @@ -1,5 +1,5 @@ # Install the Rainforest Component -Place `__init__.py` and `sensor.py` in `config\custom_components\rainforest\` +Place `__init__.py`, `manifest.json`, and `sensor.py` in `config\custom_components\rainforest\` ## Overview To use your Rainforest Automation EMU-2™ Energy Monitoring Unit in your installation, add the following to your `configuration.yaml` file: diff --git a/custom_components/rainforest/sensor.py b/custom_components/rainforest/sensor.py index 9431544..d182209 100644 --- a/custom_components/rainforest/sensor.py +++ b/custom_components/rainforest/sensor.py @@ -1,7 +1,7 @@ """ Use serial protocol of EMU2 meter to obtain state of the connected meter. For more details about this component, please refer to the documentation -at https://github.com/jrhorrisberger/home-assistant/custom_components/rainforest_emu2 +at https://github.com/jrhorrisberger/home-assistant/custom_components/rainforest """ from homeassistant.helpers.entity import Entity @@ -9,12 +9,12 @@ from homeassistant.components.sensor import PLATFORM_SCHEMA from homeassistant.const import ( CONF_NAME, EVENT_HOMEASSISTANT_STOP) - import logging import voluptuous as vol - from threading import Thread +__version__ = '0.2.0' + _LOGGER = logging.getLogger(__name__) DOMAIN = "rainforest" From 8171c965b95b3c5725c7fa66308f3841d9a1f8d0 Mon Sep 17 00:00:00 2001 From: Brian Hanifin Date: Fri, 19 Apr 2019 11:42:21 -0700 Subject: [PATCH 5/8] Update readme.md --- custom_components/rainforest/readme.md | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/custom_components/rainforest/readme.md b/custom_components/rainforest/readme.md index 243502d..b42512a 100644 --- a/custom_components/rainforest/readme.md +++ b/custom_components/rainforest/readme.md @@ -1,8 +1,17 @@ -# Install the Rainforest Component -Place `__init__.py`, `manifest.json`, and `sensor.py` in `config\custom_components\rainforest\` +# Rainforest Component ## Overview -To use your Rainforest Automation EMU-2™ Energy Monitoring Unit in your installation, add the following to your `configuration.yaml` file: +To use your Rainforest Automation EMU-2™ Energy Monitoring Unit in Home Assistant follow the `Installation` and `Configuration` instructions. + +## Installation +[__`rainforest/__init__.py`__](./__init__.py) +[__`rainforest/sensor.py`__](./sensor.py) +[__`rainforest/manifest.json`__](./manifest.json) + +Place these files in `config\custom_components\rainforest\`. + +## Configuraion +Add the following to your `configuration.yaml` file: ```yaml # Example configuration.yaml entry @@ -11,15 +20,11 @@ sensor: port: '/dev/ttyACM0' ``` -## Configuraion - - ### port: * description: The comm port which the meter is connected to. * required: true * type: string - ### name: * description: The name to use when displaying this sensor. * required: false @@ -29,4 +34,4 @@ sensor: * https://github.com/smakonin/RAEdataset/blob/master/EMU2_reader.py * https://github.com/home-assistant/home-assistant/blob/master/homeassistant/components/sensor/serial.py * https://home-assistant.io/components/sensor.date_countdown/ - * https://github.com/rainforestautomation/Emu-Serial-API + * https://github.com/rainforestautomation/Emu-Serial-API \ No newline at end of file From 03d513859b16c4ce4c445dad5f8f7ae111ebda8a Mon Sep 17 00:00:00 2001 From: Brian Hanifin Date: Fri, 19 Apr 2019 11:43:28 -0700 Subject: [PATCH 6/8] Update readme.md --- custom_components/rainforest/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/rainforest/readme.md b/custom_components/rainforest/readme.md index b42512a..bbe6e57 100644 --- a/custom_components/rainforest/readme.md +++ b/custom_components/rainforest/readme.md @@ -1,4 +1,4 @@ -# Rainforest Component +# Rainforest Energy Monitoring Component ## Overview To use your Rainforest Automation EMU-2™ Energy Monitoring Unit in Home Assistant follow the `Installation` and `Configuration` instructions. From c237ee0baa3f8c8367d06d1eee4412eb657a0477 Mon Sep 17 00:00:00 2001 From: Brian Hanifin Date: Fri, 19 Apr 2019 11:44:29 -0700 Subject: [PATCH 7/8] Update readme.md --- custom_components/rainforest/readme.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/custom_components/rainforest/readme.md b/custom_components/rainforest/readme.md index bbe6e57..dfcc7bd 100644 --- a/custom_components/rainforest/readme.md +++ b/custom_components/rainforest/readme.md @@ -4,9 +4,9 @@ To use your Rainforest Automation EMU-2™ Energy Monitoring Unit in Home Assistant follow the `Installation` and `Configuration` instructions. ## Installation -[__`rainforest/__init__.py`__](./__init__.py) -[__`rainforest/sensor.py`__](./sensor.py) -[__`rainforest/manifest.json`__](./manifest.json) +* [__`rainforest/__init__.py`__](./__init__.py) +* [__`rainforest/sensor.py`__](./sensor.py) +* [__`rainforest/manifest.json`__](./manifest.json) Place these files in `config\custom_components\rainforest\`. From 01fd352e8aabae0a75f71f2af30a94bf3be832b0 Mon Sep 17 00:00:00 2001 From: Brian Hanifin Date: Fri, 19 Apr 2019 11:44:59 -0700 Subject: [PATCH 8/8] Update readme.md --- custom_components/rainforest/readme.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/custom_components/rainforest/readme.md b/custom_components/rainforest/readme.md index dfcc7bd..490a00a 100644 --- a/custom_components/rainforest/readme.md +++ b/custom_components/rainforest/readme.md @@ -4,12 +4,11 @@ To use your Rainforest Automation EMU-2™ Energy Monitoring Unit in Home Assistant follow the `Installation` and `Configuration` instructions. ## Installation +Place the following files in `config\custom_components\rainforest\`: * [__`rainforest/__init__.py`__](./__init__.py) * [__`rainforest/sensor.py`__](./sensor.py) * [__`rainforest/manifest.json`__](./manifest.json) -Place these files in `config\custom_components\rainforest\`. - ## Configuraion Add the following to your `configuration.yaml` file: