diff --git a/changes.md b/changes.md index dd2c2c7..e900f6b 100644 --- a/changes.md +++ b/changes.md @@ -1,5 +1,12 @@ # Change Log +## v0.1.34 Added more configuration templates for devices +* Added more configuration templates for devices +* Fixed configuration for FMZ +* Fixed send message for fired gateways +* Improved writing sender ids into actuators for EEP F6-02-01/02 +* Added List for supported devices. + ## v0.1.33 Added Supported Device View * Improved template selection in Details View. * Improved GUI Details View diff --git a/docs/supported-devices.md b/docs/supported-devices.md new file mode 100644 index 0000000..92ab1a9 --- /dev/null +++ b/docs/supported-devices.md @@ -0,0 +1,86 @@ +# List of Supported Devices +Devices not contained in this list are quite likely already supported by existing devices in this list. +
+(This list is auto-generated by using template definitions in [data_helper.py](https://github.com/grimmpp/enocean-device-manager/blob/main/eo_man/data/data_helper.py).) +
+| Brand | Name | Description | EEP | Sender EEP | HA Platform | +|-----|-----|-----|-----|-----|-----| +| Eltako | FAM14 | Bus Gateway | | | | +| Eltako | FGW14_USB | Bus Gateway | | | | +| Eltako | FTD14 | Bus Gateway | | | | +| Eltako | FGW14 | Bus Gateway | | | | +| Eltako | FAM-USB | USB Gateway | | | | +| unknown | USB300 | USB Gateway | | | | +| PioTek | MGW (LAN) | USB Gateway | | | | +| PioTek | MGW (USB) | USB Gateway | | | | +| Eltako | FTS14EM | Wired Rocker switch | F6-02-01 | | binary_sensor | +| Eltako | FTS14EM | Wired Rocker switch | F6-02-02 | | binary_sensor | +| Eltako | FTS14EM | Window handle | F6-10-00 | | binary_sensor | +| Eltako | FTS14EM | Contact sensor | D5-00-01 | | binary_sensor | +| Eltako | FTS14EM | Occupancy sensor | A5-08-01 | | binary_sensor | +| Eltako | FT55 | Wireless 4-way pushbutton | F6-02-01 | | binary_sensor | +| Eltako | F4T55E | Wireless 4-way pushbutton in E-Design55 | F6-02-01 | | binary_sensor | +| Eltako | FFTE | window and door contacts | F6-10-00 | | binary_sensor | +| Eltako | FTKE | window and door contacts | F6-10-00 | | binary_sensor | +| Eltako | FTK | window and door contacts | F6-10-00 | | binary_sensor | +| Eltako | FSDG14 | Electricity Meter | A5-12-01 | | sensor | +| Eltako | F3Z14D | Electricity Meter | A5-12-01 | | sensor | +| Eltako | FSVA-230V-10A-Power-Meter | Power Meter | A5-12-01 | | sensor | +| Eltako | F3Z14D | Gas Meter | A5-12-02 | | sensor | +| Eltako | F3Z14D | Water Meter | A5-12-03 | | sensor | +| Eltako | FWZ14_65A | Electricity Meter | A5-12-01 | | sensor | +| Eltako | FWG14MS | Weather Station Gateway | A5-13-01 | | sensor | +| Eltako | MS | Weather Station | A5-13-01 | | sensor | +| Eltako | WMS | Weather Station | A5-13-01 | | sensor | +| Eltako | FWS61 | Weather Station | A5-13-01 | | sensor | +| Eltako | FLGTF | Temperature and Humidity Sensor | A5-04-02 | | sensor | +| Eltako | FLT58 | Temperature and Humidity Sensor | A5-04-02 | | sensor | +| Eltako | FFT60 | Temperature and Humidity Sensor | A5-04-02 | | sensor | +| Eltako | FTFSB | Temperature and Humidity Sensor | A5-04-02 | | sensor | +| Eltako | FHD60SB | Light - Twilight and daylight Sensor | A5-06-01 | | sensor | +| Eltako | FABH65S | Light-, Temperature-, Occupancy Sensor | A5-08-01 | | sensor | +| Eltako | FBH65 | Light-, Temperature-, Occupancy Sensor | A5-08-01 | | sensor | +| Eltako | FBH65S | Light-, Temperature-, Occupancy Sensor | A5-08-01 | | sensor | +| Eltako | FBH65TF | Light-, Temperature-, Occupancy Sensor | A5-08-01 | | sensor | +| Eltako | FLGTF | Air Quality, Temperature and Humidity Sensor | A5-09-0C | | sensor | +| Eltako | FUTH | Temperature Sensor and Controller | A5-10-06 | | sensor | +| Eltako | FUTH-feature | Temperature Sensor and Controller and Humidity Sensor | A5-10-12 | | sensor | +| Eltako | FUD14 | Light dimmer | A5-38-08 | A5-38-08 | light | +| Eltako | FUD14_800W | Light dimmer | A5-38-08 | A5-38-08 | light | +| Eltako | FDG14 | Dali Gateway | A5-38-08 | A5-38-08 | light | +| Eltako | FD2G14 | Dali Gateway | A5-38-08 | A5-38-08 | light | +| Eltako | FMZ14 | Relay | M5-38-08 | F6-02-01 | light | +| Eltako | FSR14 | Relay | M5-38-08 | A5-38-08 | light | +| Eltako | FSR14_1x | Relay | M5-38-08 | A5-38-08 | light | +| Eltako | FSR14_2x | Relay | M5-38-08 | A5-38-08 | light | +| Eltako | FSR14_4x | Relay | M5-38-08 | A5-38-08 | light | +| Eltako | FSR14M_2x | Relay | M5-38-08 | A5-38-08 | light | +| Eltako | FSR14M_2x-feature | Electricity Meter | A5-12-01 | | sensor | +| Eltako | F4SR14_LED | Relay | M5-38-08 | A5-38-08 | light | +| Eltako | FSB14 | Cover | G5-3F-7F | H5-3F-7F | cover | +| Eltako | FHK14 | Heating/Cooling | A5-10-06 | A5-10-06 | climate | +| Eltako | F4HK14 | Heating/Cooling | A5-10-06 | A5-10-06 | climate | +| Eltako | FAE14SSR | Heating/Cooling | A5-10-06 | A5-10-06 | climate | +| Eltako | FMZ61 | Relay | M5-38-08 | F6-02-01 | light | +| Eltako | FSR61-230V | Relay | M5-38-08 | A5-38-08 | light | +| Eltako | FSR61NP-230V | Relay | M5-38-08 | A5-38-08 | light | +| Eltako | FSR61/8-24V UC | Relay | M5-38-08 | A5-38-08 | light | +| Eltako | FSR61-230V | Relay | M5-38-08 | A5-38-08 | light | +| Eltako | FSR61G-230V | Relay | M5-38-08 | A5-38-08 | light | +| Eltako | FSR61LN-230V | Relay | M5-38-08 | A5-38-08 | light | +| Eltako | FLC61NP-230V | Relay | M5-38-08 | A5-38-08 | light | +| Eltako | FR62-230V | Relay | M5-38-08 | A5-38-08 | light | +| Eltako | FR62NP-230V | Relay | M5-38-08 | A5-38-08 | light | +| Eltako | FL62-230V | Relay | M5-38-08 | A5-38-08 | light | +| Eltako | FL62NP-230V | Relay | M5-38-08 | A5-38-08 | light | +| Eltako | FSSA-230V | Socket Switch Actuator | M5-38-08 | A5-38-08 | light | +| Eltako | FSVA-230V-10A | Socket Switch Actuator | M5-38-08 | A5-38-08 | light | +| Eltako | FUD61NP-230V | Light dimmer | A5-38-08 | A5-38-08 | light | +| Eltako | FUD61NPN-230V | Light dimmer | A5-38-08 | A5-38-08 | light | +| Eltako | FD62NP-230V | Relay | A5-38-08 | A5-38-08 | light | +| Eltako | FD62NPN-230V | Relay | A5-38-08 | A5-38-08 | light | +| Eltako | FSB61-230V | Cover | G5-3F-7F | H5-3F-7F | cover | +| Eltako | FSB61NP-230V | Cover | G5-3F-7F | H5-3F-7F | cover | +| Eltako | FJ62/12-36V DC | Cover | G5-3F-7F | H5-3F-7F | cover | +| Eltako | FJ62NP-230V | Cover | G5-3F-7F | H5-3F-7F | cover | +| Eltako | FSUD-230V | Cover | G5-3F-7F | H5-3F-7F | cover | diff --git a/eo_man/controller/serial_controller.py b/eo_man/controller/serial_controller.py index fe7cedf..c5f190e 100644 --- a/eo_man/controller/serial_controller.py +++ b/eo_man/controller/serial_controller.py @@ -67,7 +67,7 @@ def get_serial_ports(self, device_type:str, force_reload:bool=False) ->list[str] return [] def is_connected_gateway_device_bus(self): - return self.connected_gateway_type == 'FAM14' or self.connected_gateway_type == 'FGW14-USB' + return self.connected_gateway_type.startswith('FAM14') or self.connected_gateway_type.startswith('FGW14-USB') def _get_gateway2serial_port_mapping(self) -> dict[str:list[str]]: """ Lists serial port names diff --git a/eo_man/data/const.py b/eo_man/data/const.py index 47e699d..d1cef18 100644 --- a/eo_man/data/const.py +++ b/eo_man/data/const.py @@ -5,7 +5,7 @@ from typing import Final -from homeassistant.const import Platform +from homeassistant.const import * DOMAIN: Final = "eltako" DATA_ELTAKO: Final = "eltako" diff --git a/eo_man/data/data_helper.py b/eo_man/data/data_helper.py index 3e0da6c..e7738ed 100644 --- a/eo_man/data/data_helper.py +++ b/eo_man/data/data_helper.py @@ -44,8 +44,10 @@ # metering {'hw-type': 'FSDG14', 'brand': 'Eltako', CONF_EEP: 'A5-12-01', CONF_TYPE: Platform.SENSOR, 'description': 'Electricity Meter', 'address_count': 1}, {'hw-type': 'F3Z14D', 'brand': 'Eltako', CONF_EEP: 'A5-12-01', CONF_TYPE: Platform.SENSOR, 'description': 'Electricity Meter', 'address_count': 3}, + {'hw-type': 'FSVA-230V-10A-Power-Meter', 'brand': 'Eltako', CONF_EEP: 'A5-12-01', CONF_TYPE: Platform.SENSOR, CONF_METER_TARIFFS: '[]', 'description': 'Power Meter', 'address_count': 1}, {'hw-type': 'F3Z14D', 'brand': 'Eltako', CONF_EEP: 'A5-12-02', CONF_TYPE: Platform.SENSOR, 'description': 'Gas Meter', 'address_count': 3}, {'hw-type': 'F3Z14D', 'brand': 'Eltako', CONF_EEP: 'A5-12-03', CONF_TYPE: Platform.SENSOR, 'description': 'Water Meter', 'address_count': 3}, + {'hw-type': 'FWZ14_65A', 'brand': 'Eltako', CONF_EEP: 'A5-12-01', CONF_TYPE: Platform.SENSOR, CONF_METER_TARIFFS: '[]', 'description': 'Electricity Meter', 'address_count': 1}, # Weather Station {'hw-type': 'FWG14MS', 'brand': 'Eltako', CONF_EEP: 'A5-13-01', CONF_TYPE: Platform.SENSOR, 'description': 'Weather Station Gateway', 'address_count': 1}, @@ -57,6 +59,10 @@ {'hw-type': 'FLGTF', 'brand': 'Eltako', CONF_EEP: 'A5-04-02', CONF_TYPE: Platform.SENSOR, 'description': 'Temperature and Humidity Sensor', 'address_count': 1}, {'hw-type': 'FLT58', 'brand': 'Eltako', CONF_EEP: 'A5-04-02', CONF_TYPE: Platform.SENSOR, 'description': 'Temperature and Humidity Sensor', 'address_count': 1}, {'hw-type': 'FFT60', 'brand': 'Eltako', CONF_EEP: 'A5-04-02', CONF_TYPE: Platform.SENSOR, 'description': 'Temperature and Humidity Sensor', 'address_count': 1}, + {'hw-type': 'FTFSB', 'brand': 'Eltako', CONF_EEP: 'A5-04-02', CONF_TYPE: Platform.SENSOR, 'description': 'Temperature and Humidity Sensor', 'address_count': 1}, + + # light sensor + {'hw-type': 'FHD60SB', 'brand': 'Eltako', CONF_EEP: 'A5-06-01', CONF_TYPE: Platform.SENSOR, 'description': 'Light - Twilight and daylight Sensor', 'address_count': 1}, # occupancy sensor {'hw-type': 'FABH65S', 'brand': 'Eltako', CONF_EEP: 'A5-08-01', CONF_TYPE: Platform.SENSOR, 'description': 'Light-, Temperature-, Occupancy Sensor', 'address_count': 1}, @@ -80,7 +86,7 @@ {'hw-type': 'FD2G14', 'brand': 'Eltako', CONF_EEP: 'A5-38-08', 'sender_eep': 'A5-38-08', CONF_TYPE: Platform.LIGHT, 'PCT14-function-group': 1, 'PCT14-key-function': 32, 'description': 'Dali Gateway', 'address_count': 16}, # relays - {'hw-type': 'FMZ14', 'brand': 'Eltako', CONF_EEP: 'M5-38-08', 'sender_eep': 'A5-38-08', CONF_TYPE: Platform.LIGHT, 'PCT14-function-group': 1, 'description': 'Relay', 'address_count': 1}, + {'hw-type': 'FMZ14', 'brand': 'Eltako', CONF_EEP: 'M5-38-08', 'sender_eep': 'F6-02-01', CONF_TYPE: Platform.LIGHT, 'PCT14-function-group': 1, 'PCT14-key-function': 1, 'description': 'Relay', 'address_count': 1}, {'hw-type': 'FSR14', 'brand': 'Eltako', CONF_EEP: 'M5-38-08', 'sender_eep': 'A5-38-08', CONF_TYPE: Platform.LIGHT, 'PCT14-function-group': 2, 'PCT14-key-function': 51, 'description': 'Relay', 'address_count': 1}, {'hw-type': 'FSR14_1x', 'brand': 'Eltako', CONF_EEP: 'M5-38-08', 'sender_eep': 'A5-38-08', CONF_TYPE: Platform.LIGHT, 'PCT14-function-group': 2, 'PCT14-key-function': 51, 'description': 'Relay', 'address_count': 1}, {'hw-type': 'FSR14_2x', 'brand': 'Eltako', CONF_EEP: 'M5-38-08', 'sender_eep': 'A5-38-08', CONF_TYPE: Platform.LIGHT, 'PCT14-function-group': 2, 'PCT14-key-function': 51, 'description': 'Relay', 'address_count': 2}, @@ -98,15 +104,33 @@ {'hw-type': 'FAE14SSR', 'brand': 'Eltako', CONF_EEP: 'A5-10-06', 'sender_eep': 'A5-10-06', CONF_TYPE: Platform.CLIMATE, 'PCT14-function-group': 3, 'PCT14-key-function': 65, 'description': 'Heating/Cooling', 'address_count': 2}, # decentralized relays - {'hw-type': 'FSR61NP', 'brand': 'Eltako', CONF_EEP: 'M5-38-08', 'sender_eep': 'A5-38-08', CONF_TYPE: Platform.LIGHT, 'description': 'Relay', 'address_count': 1}, + {'hw-type': 'FMZ61', 'brand': 'Eltako', CONF_EEP: 'M5-38-08', 'sender_eep': 'F6-02-01', CONF_TYPE: Platform.LIGHT, 'description': 'Relay', 'address_count': 1}, + {'hw-type': 'FSR61-230V', 'brand': 'Eltako', CONF_EEP: 'M5-38-08', 'sender_eep': 'A5-38-08', CONF_TYPE: Platform.LIGHT, 'description': 'Relay', 'address_count': 1}, + {'hw-type': 'FSR61NP-230V', 'brand': 'Eltako', CONF_EEP: 'M5-38-08', 'sender_eep': 'A5-38-08', CONF_TYPE: Platform.LIGHT, 'description': 'Relay', 'address_count': 1}, {'hw-type': 'FSR61/8-24V UC', 'brand': 'Eltako', CONF_EEP: 'M5-38-08', 'sender_eep': 'A5-38-08', CONF_TYPE: Platform.LIGHT, 'description': 'Relay', 'address_count': 1}, {'hw-type': 'FSR61-230V', 'brand': 'Eltako', CONF_EEP: 'M5-38-08', 'sender_eep': 'A5-38-08', CONF_TYPE: Platform.LIGHT, 'description': 'Relay', 'address_count': 1}, {'hw-type': 'FSR61G-230V', 'brand': 'Eltako', CONF_EEP: 'M5-38-08', 'sender_eep': 'A5-38-08', CONF_TYPE: Platform.LIGHT, 'description': 'Relay', 'address_count': 1}, - {'hw-type': 'FSR61LN-230V', 'brand': 'Eltako', CONF_EEP: 'M5-38-08', 'sender_eep': 'A5-38-08', CONF_TYPE: Platform.LIGHT, 'description': 'Relay', 'address_count': 1}, + {'hw-type': 'FSR61LN-230V', 'brand': 'Eltako', CONF_EEP: 'M5-38-08', 'sender_eep': 'A5-38-08', CONF_TYPE: Platform.LIGHT, 'description': 'Relay', 'address_count': 2}, + {'hw-type': 'FLC61NP-230V', 'brand': 'Eltako', CONF_EEP: 'M5-38-08', 'sender_eep': 'A5-38-08', CONF_TYPE: Platform.LIGHT, 'description': 'Relay', 'address_count': 1}, + {'hw-type': 'FR62-230V', 'brand': 'Eltako', CONF_EEP: 'M5-38-08', 'sender_eep': 'A5-38-08', CONF_TYPE: Platform.LIGHT, 'description': 'Relay', 'address_count': 1}, + {'hw-type': 'FR62NP-230V', 'brand': 'Eltako', CONF_EEP: 'M5-38-08', 'sender_eep': 'A5-38-08', CONF_TYPE: Platform.LIGHT, 'description': 'Relay', 'address_count': 1}, + {'hw-type': 'FL62-230V', 'brand': 'Eltako', CONF_EEP: 'M5-38-08', 'sender_eep': 'A5-38-08', CONF_TYPE: Platform.LIGHT, 'description': 'Relay', 'address_count': 1}, + {'hw-type': 'FL62NP-230V', 'brand': 'Eltako', CONF_EEP: 'M5-38-08', 'sender_eep': 'A5-38-08', CONF_TYPE: Platform.LIGHT, 'description': 'Relay', 'address_count': 1}, + {'hw-type': 'FSSA-230V', 'brand': 'Eltako', CONF_EEP: 'M5-38-08', 'sender_eep': 'A5-38-08', CONF_TYPE: Platform.LIGHT, 'description': 'Socket Switch Actuator', 'address_count': 1}, + {'hw-type': 'FSVA-230V-10A', 'brand': 'Eltako', CONF_EEP: 'M5-38-08', 'sender_eep': 'A5-38-08', CONF_TYPE: Platform.LIGHT, 'description': 'Socket Switch Actuator', 'address_count': 1}, + + # decentralized dimmers + {'hw-type': 'FUD61NP-230V', 'brand': 'Eltako', CONF_EEP: 'A5-38-08', 'sender_eep': 'A5-38-08', CONF_TYPE: Platform.LIGHT, 'description': 'Light dimmer', 'address_count': 1}, + {'hw-type': 'FUD61NPN-230V', 'brand': 'Eltako', CONF_EEP: 'A5-38-08', 'sender_eep': 'A5-38-08', CONF_TYPE: Platform.LIGHT, 'description': 'Light dimmer', 'address_count': 1}, + {'hw-type': 'FD62NP-230V', 'brand': 'Eltako', CONF_EEP: 'A5-38-08', 'sender_eep': 'A5-38-08', CONF_TYPE: Platform.LIGHT, 'description': 'Relay', 'address_count': 1}, + {'hw-type': 'FD62NPN-230V', 'brand': 'Eltako', CONF_EEP: 'A5-38-08', 'sender_eep': 'A5-38-08', CONF_TYPE: Platform.LIGHT, 'description': 'Relay', 'address_count': 1}, # decentralized covers {'hw-type': 'FSB61-230V', 'brand': 'Eltako', CONF_EEP: 'G5-3F-7F', 'sender_eep': 'H5-3F-7F', CONF_TYPE: Platform.COVER, 'address_count': 1, 'description': 'Cover'}, {'hw-type': 'FSB61NP-230V', 'brand': 'Eltako', CONF_EEP: 'G5-3F-7F', 'sender_eep': 'H5-3F-7F', CONF_TYPE: Platform.COVER, 'address_count': 1, 'description': 'Cover'}, + {'hw-type': 'FJ62/12-36V DC', 'brand': 'Eltako', CONF_EEP: 'G5-3F-7F', 'sender_eep': 'H5-3F-7F', CONF_TYPE: Platform.COVER, 'address_count': 1, 'description': 'Cover'}, + {'hw-type': 'FJ62NP-230V', 'brand': 'Eltako', CONF_EEP: 'G5-3F-7F', 'sender_eep': 'H5-3F-7F', CONF_TYPE: Platform.COVER, 'address_count': 1, 'description': 'Cover'}, + {'hw-type': 'FSUD-230V', 'brand': 'Eltako', CONF_EEP: 'G5-3F-7F', 'sender_eep': 'H5-3F-7F', CONF_TYPE: Platform.COVER, 'address_count': 1, 'description': 'Cover'}, ] ORG_MAPPING = { @@ -117,7 +141,6 @@ SENSOR_MESSAGE_TYPES = [EltakoWrappedRPS, EltakoWrapped4BS, RPSMessage, Regular4BSMessage, Regular1BSMessage, EltakoMessage] - def get_all_eep_names(): subclasses = set() work = [EEP] diff --git a/eo_man/view/device_info_window.py b/eo_man/view/device_info_window.py index 12b06aa..73a4b89 100644 --- a/eo_man/view/device_info_window.py +++ b/eo_man/view/device_info_window.py @@ -9,7 +9,6 @@ from tkscrolledframe import ScrolledFrame from ..data.const import * -from homeassistant.const import * from .donation_button import DonationButton @@ -55,8 +54,8 @@ def __init__(self, main:Tk): m.get('hw-type', ''), m.get('description', ''), m.get(CONF_EEP, ''), - m.get(CONF_TYPE, ''), m.get('sender_eep', ''), + m.get(CONF_TYPE, ''), m.get('docs', '') )) diff --git a/eo_man/view/send_message_window.py b/eo_man/view/send_message_window.py index a5c2101..781c2d5 100644 --- a/eo_man/view/send_message_window.py +++ b/eo_man/view/send_message_window.py @@ -376,7 +376,11 @@ def close(self): def set_sender_ids(self): - base_id = self.serial_controller.current_base_id + # not wired gateway + if not self.serial_controller.is_connected_gateway_device_bus(): + base_id = self.serial_controller.current_base_id + else: + base_id = '00-00-B0-00' if self.serial_controller.current_base_id and not self.serial_controller.is_connected_gateway_device_bus(): base_id = self.serial_controller.current_base_id diff --git a/requirements.txt b/requirements.txt index 3d1be41..34f9b1b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ aiocoap==0.4.7 -eltako14bus==0.0.62 +eltako14bus==0.0.63 numpy==1.26.3 pillow==10.2.0 pyserial==3.5 diff --git a/setup.py b/setup.py index e371b7f..b2fd71d 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,7 @@ with open('LICENSE', encoding="utf-8") as f: license = f.read() -required = ['eltako14bus==0.0.62', 'requests==2.31.0', 'enocean==0.60.1', 'pyserial', 'pyserial-asyncio', 'aiocoap', +required = ['eltako14bus==0.0.63', 'requests==2.31.0', 'enocean==0.60.1', 'pyserial', 'pyserial-asyncio', 'aiocoap', 'tkScrolledFrame==1.0.4', 'esp2_gateway_adapter==0.2.9', # 'homeassistant', @@ -28,7 +28,7 @@ setup( name='eo_man', - version='0.1.33', + version='0.1.34', package_dir={'eo_man':"eo_man"}, # packages=find_packages("./eo-man"), #package_data={'': ['*.png']}, diff --git a/tests/test_generate_docs.py b/tests/test_generate_docs.py new file mode 100644 index 0000000..cec1d33 --- /dev/null +++ b/tests/test_generate_docs.py @@ -0,0 +1,36 @@ +import os +import sys +import unittest + +file_dir = os.path.join( os.path.dirname(__file__), '..', 'eo_man', 'data') +sys.path.append(file_dir) +__import__('homeassistant') + +from eo_man.data.data_helper import EEP_MAPPING +from eo_man.data.const import CONF_EEP, CONF_TYPE + +class TestGenerateDocs(unittest.TestCase): + + def test_generate_list_of_supported_devices(self): + text = "# List of Supported Devices \n" + text += "Devices not contained in this list are quite likely already supported by existing devices in this list. \n" + + text += "
\n" + text += "(This list is auto-generated by using template definitions in [data_helper.py](https://github.com/grimmpp/enocean-device-manager/blob/main/eo_man/data/data_helper.py).) \n" + text += "
\n" + + text += "| Brand | Name | Description | EEP | Sender EEP | HA Platform | \n" + keys = ['brand', 'hw-type', 'description', CONF_EEP, 'sender_eep', CONF_TYPE] + for k in keys: + text += "|-----" + text += "| \n" + + for e in EEP_MAPPING: + if e.get('hw-type', '') is not 'BusObject': + for k in keys: + text += f"| {e.get(k, '')} " + text += "| \n" + + file='./docs/supported-devices.md' + with open(file, 'w') as filetowrite: + filetowrite.write(text) \ No newline at end of file