Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/smarthomeNG/plugins into…
Browse files Browse the repository at this point in the history
… develop
  • Loading branch information
aschwith committed Sep 17, 2023
2 parents 1fc76f5 + d12cc52 commit c1cc244
Show file tree
Hide file tree
Showing 22 changed files with 136 additions and 107 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ ehthumbs.db
Thumbs.db

# don't upload private plugins
/priv_*
/priv_*/

# don't upload plugins loaded from develop to a release installation
/*_dev/

# Pycharm settings
/.idea
Expand Down
4 changes: 3 additions & 1 deletion byd_bat/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
# V0.0.3 230819 - Code mit pycodestyle kontrolliert/angepasst
# - Anpassungen durch 'check_plugin'
#
# V0.0.4 230904 - Bilder JPG in PNG konvertiert fuer user_doc.rst
#
# -----------------------------------------------------------------------
#
# Als Basis fuer die Implementierung wurde die folgende Quelle verwendet:
Expand Down Expand Up @@ -176,7 +178,7 @@ class properties and methods (class variables and class functions)
are already available!
"""

PLUGIN_VERSION = '0.0.3'
PLUGIN_VERSION = '0.0.4'

def __init__(self,sh):
"""
Expand Down
2 changes: 1 addition & 1 deletion byd_bat/plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ plugin:
# documentation: https://github.com/smarthomeNG/smarthome/wiki/CLI-Plugin # url of documentation (wiki) page
support: https://knx-user-forum.de/forum/supportforen/smarthome-py/1886748-support-thread-f%C3%BCr-das-byd-batterie-plugin

version: 0.0.3 # Plugin version (must match the version specified in __init__.py)
version: 0.0.4 # Plugin version (must match the version specified in __init__.py)
sh_minversion: 1.9 # minimum shNG version to use this plugin
# sh_maxversion: # maximum shNG version to use this plugin (leave empty if latest)
# py_minversion: 3.6 # minimum Python version to use for this plugin
Expand Down
28 changes: 14 additions & 14 deletions byd_bat/user_doc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ Anforderungen
Der BYD Energiespeicher muss mit dem LAN verbunden sind. Die IP-Adresse des BYD wird über DHCP zugewiesen und muss ermittelt werden. Diese IP-Adresse muss in der Plugin-Konfiguration gespeichert werden.

Notwendige Software
~~~~~~~~~~~~~~~~~~~
-------------------

* matplotlib

Unterstützte Geräte
~~~~~~~~~~~~~~~~~~~
-------------------

Folgende Typen werden unterstützt:

Expand All @@ -53,27 +53,27 @@ Konfiguration
=============

plugin.yaml
~~~~~~~~~~~
-----------

Bitte die Dokumentation lesen, die aus den Metadaten der plugin.yaml erzeugt wurde.
Zu den Informationen, welche Parameter in der ../etc/plugin.yaml konfiguriert werden können bzw. müssen, bitte die Dokumentation :doc:`Dokumentation </plugins_doc/config/byd_bat>` lesen, die aus den Metadaten der plugin.yaml erzeugt wurde.


items.yaml
~~~~~~~~~~
----------

Bitte die Dokumentation lesen, die aus den Metadaten der plugin.yaml erzeugt wurde.
Zu den Informationen, welche Attribute in der Item Konfiguration verwendet werden können bzw. müssen, bitte die Dokumentation :doc:`Dokumentation </plugins_doc/config/byd_bat>` lesen, die aus den Metadaten der plugin.yaml erzeugt wurde.


logic.yaml
~~~~~~~~~~
----------

Bitte die Dokumentation lesen, die aus den Metadaten der plugin.yaml erzeugt wurde.
Zu den Informationen, welche Konfigurationsmöglichkeiten für Logiken bestehen, bitte die Dokumentation :doc:`Dokumentation </plugins_doc/config/byd_bat>` lesen, die aus den Metadaten der plugin.yaml erzeugt wurde.


Funktionen
~~~~~~~~~~
----------

Bitte die Dokumentation lesen, die aus den Metadaten der plugin.yaml erzeugt wurde.
Zu den Informationen, welche Funktionen das Plugin bereitstellt (z.B. zur Nutzung in Logiken), bitte die Dokumentation :doc:`Dokumentation </plugins_doc/config/byd_bat>` lesen, die aus den Metadaten der plugin.yaml erzeugt wurde.

Web Interface
=============
Expand All @@ -87,20 +87,20 @@ Oben rechts werden die wichtigsten Daten zum BYD Energiespeicher angezeigt.

Im Tab "BYD Home" sind die Grunddaten des Energiespeichers dargestellt:

.. image:: assets/home.JPG
.. image:: assets/home.png
:class: screenshot

Im Tab "BYD Diagnose" werden Diagnosedaten angezeigt:

.. image:: assets/diag.JPG
.. image:: assets/diag.png
:class: screenshot

Im Tab "BYD Spannungen" werden die Spannungen der Module als Heatmap angezeigt:

.. image:: assets/volt.JPG
.. image:: assets/volt.png
:class: screenshot

Im Tab "BYD Temperaturen" werden die Temperaturen der Module als Heatmap angezeigt:

.. image:: assets/temp.JPG
.. image:: assets/temp.png
:class: screenshot
Binary file removed byd_bat/webif/static/img/diag.JPG
Binary file not shown.
Binary file added byd_bat/webif/static/img/diag.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed byd_bat/webif/static/img/home.JPG
Binary file not shown.
Binary file added byd_bat/webif/static/img/home.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed byd_bat/webif/static/img/temp.JPG
Binary file not shown.
Binary file added byd_bat/webif/static/img/temp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed byd_bat/webif/static/img/volt.JPG
Binary file not shown.
Binary file added byd_bat/webif/static/img/volt.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion garminconnect/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
garminconnect>=0.1.28
garminconnect>=0.1.28,<0.2.0;python_version<='3.9'
garminconnect>=0.1.28;python_version>='3.10'
8 changes: 6 additions & 2 deletions mailsend/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,15 @@ def __call__(self, to, sub, msg, caller=None, source=None):
pass
self.logger.debug("email was sent")

def extended(self, to, sub, msg, sender_name: str, img_list: list=[], attachments: list=[]):
def extended(self, to, sub, msg, sender_name: str, img_list: list=None, attachments: list=None, caller=None, source=None):
if img_list is None:
img_list = []
if attachments is None:
attachments = []
try:
smtp = self._connect()
except Exception as e:
self.logger.warning("Could not connect to {0}: {1}".format(self._host, e))
self.logger.warning(f"Could not connect to {self._host}: {e}")
return
try:
sender_name = Header(sender_name, 'utf-8').encode()
Expand Down
1 change: 1 addition & 0 deletions odlinfo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ odlinfo:
class_name: ODLInfo
class_path: plugins.odlinfo
cycle: 3600
verify: True
```
### items.yaml
Expand Down
5 changes: 3 additions & 2 deletions odlinfo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
import cherrypy

class ODLInfo(SmartPlugin):
PLUGIN_VERSION = "1.5.2"
PLUGIN_VERSION = "1.5.3"
_base_url = 'https://www.imis.bfs.de/ogc/opendata/ows'

def __init__(self, sh, *args, **kwargs):
Expand All @@ -55,6 +55,7 @@ def __init__(self, sh, *args, **kwargs):
if not self.init_webinterface(WebInterface):
self._init_complete = False
self._cycle = self.get_parameter_value('cycle')
self._verify = self.get_parameter_value('verify')
self._stations = []
self._items = {}
self._update_timestamp = None
Expand Down Expand Up @@ -88,7 +89,7 @@ def _get_stations(self):
"""
try:
parameters = "service=WFS&version=1.1.0&request=GetFeature&typeName=opendata:odlinfo_odl_1h_latest&outputFormat=application/json&sortBy=plz"
response = self._session.get(self._build_url(parameters))
response = self._session.get(self._build_url(parameters), verify=self._verify)
self._update_timestamp = self.shtime.now()

except Exception as e:
Expand Down
8 changes: 7 additions & 1 deletion odlinfo/plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ plugin:
documentation: https://smarthomeng.de/user/plugins_doc/config/odlinfo.html
support: https://knx-user-forum.de/node/986480

version: 1.5.2 # Plugin version
version: 1.5.3 # Plugin version
sh_minversion: 1.6 # minimum shNG version to use this plugin
# sh_maxversion: # maximum shNG version to use this plugin (leave empty if latest)
multi_instance: False # plugin supports multi instance
Expand All @@ -27,6 +27,12 @@ parameters:
description:
de: '(optional) Zeit zwischen zwei Updateläufen. Default ist 3600 Sekunden.'
en: '(optional) Time period between two update cycles. Default is 3600 seconds.'
verify:
type: bool
default: True
description:
de: 'Schaltet die Prüfung der Zertifikate des odlinfo Endpunkts ab.'
en: 'Removes certificate validation of the odlinfo endpoint.'

item_attributes:
# Definition of item attributes defined by this plugin
Expand Down
17 changes: 11 additions & 6 deletions shelly/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class Shelly(MqttPlugin):
the update functions for the items
"""

PLUGIN_VERSION = '1.8.0'
PLUGIN_VERSION = '1.8.1'


def __init__(self, sh):
Expand Down Expand Up @@ -361,7 +361,7 @@ def update_Gen1_from_item(self, item, config_data):
# Support methods for Gen1 and Gen2 devices
# ----------------------------------------------------------------------------------------------

def get_shelly_device_from_item(self, item):
def get_shelly_device_from_item(self, item) -> dict:
"""
Get the shelly device data for a device specified by an item object
Expand Down Expand Up @@ -1078,6 +1078,8 @@ def handle_gen1_info(self, shelly_id, topic, payload):
elif property == 'sensor':
self.update_items_from_status(shelly_id, 'sensor', 'state', sub_property['state'], 'info')

elif property == 'charger':
self.update_items_from_status(shelly_id, 'sensor', property, sub_property)
elif property == 'bat':
self.update_items_from_status(shelly_id, 'sensor', 'battery', sub_property['value'], 'info')
self.update_items_from_status(shelly_id, 'sensor', 'voltage', sub_property['voltage'], 'info')
Expand All @@ -1092,8 +1094,7 @@ def handle_gen1_info(self, shelly_id, topic, payload):
self.shelly_devices[shelly_id]['rssi'] = sub_property.get('rssi', '')

else:
self.log_unhandled_status(shelly_id, property, sub_property, topic=topic, payload=payload,
position='*1')
self.log_unhandled_status(shelly_id, property, sub_property, topic=topic, payload=payload, position='*1')

return

Expand All @@ -1113,8 +1114,10 @@ def handle_gen1_status(self, shelly_id: str, property, topic, payload, group=Non
property_mapping = {'temperature': 'temp', 'temperature_f': 'temp_f'}
if property.startswith('command'):
pass
elif property == 'loaderror':
elif property in ['loaderror']:
pass
elif property == 'charger':
self.update_items_from_status(shelly_id, 'sensor', property, payload)
elif property == 'online':
self.update_items_from_status(shelly_id, '', property, payload)
elif property in ['temperature', 'temperature_f', 'overtemperature', 'overpower', 'input']:
Expand All @@ -1127,7 +1130,9 @@ def handle_gen1_status(self, shelly_id: str, property, topic, payload, group=Non
self.log_unhandled_status(shelly_id, property, payload, topic=topic, payload=payload, position='*1.1')

elif group.startswith('switch:'):
if property in ['output', 'power', 'energy']:
if property == 'command': # ignore commands sent to the shelly device
pass
elif property in ['output', 'power', 'energy']:
self.update_items_from_status(shelly_id, group, property, payload)
self.logger.dbghigh(f"handle_gen1_status: {shelly_id} {group} - {property}={payload} - (mapping={group + '-' + property})")
else:
Expand Down
2 changes: 1 addition & 1 deletion shelly/plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ plugin:
# documentation: http://smarthomeng.de/user/plugins/mqtt2/user_doc.html
support: https://knx-user-forum.de/forum/supportforen/smarthome-py/1451853-support-thread-für-das-shelly-plugin

version: 1.8.0 # Plugin version
version: 1.8.1 # Plugin version
sh_minversion: 1.9.5.6 # minimum shNG version to use this plugin
# sh_maxversion: # maximum shNG version to use this plugin (leave empty if latest)
multi_instance: True # plugin supports multi instance
Expand Down
2 changes: 1 addition & 1 deletion shelly/user_doc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ die Dokumentation des jeweiligen Devices zu Rate ziehen.
Konfiguration
=============

Zurzeit werden eine Reihe von Shelly Devices mit Gen1 API im **Backward-Compatibility Mode** unterstützt. Dabei handelt
Zurzeit werden eine Reihe von Shelly Devices mit Gen1 API im **Backward-Co^mpatibility Mode** unterstützt. Dabei handelt
es sich um die Devices, die bereits in der v1.2.0 des Plugins unterstützt wurden. Diese Devices werden konfiguriert,
wie es bis zur v1.2.0 des shally Plugins üblich war.

Expand Down
Loading

0 comments on commit c1cc244

Please sign in to comment.