Hi Tom,

thanks for your hints ... very usefull ;-)
I adapted the files.

Thanks
Alex

Tom Keffer schrieb am Mittwoch, 4. November 2020 um 13:47:01 UTC+1:

> You are welcome to add your extension to the Wiki entry page.
>
> A few small things:
>
> 1. You are not using the imports
>
> import os
> from datetime import time, date, datetime
> import weeutil.weeutil
>
>
> so they can safely be remove from knx.py
>
> 2. You used the old style "syslog" way of logging. This has been replaced 
> with a "logging" based approach. See the wiki article WeeWX V4 and Logging 
> <https://github.com/weewx/weewx/wiki/WeeWX-v4-and-logging>, in 
> particular, the section *Maintaining backwards compatibility 
> <https://github.com/weewx/weewx/wiki/WeeWX-v4-and-logging#maintaining-backwards-compatibility>*
> . 
>
> 3. You are making a copy of the configuration dictionary, then modifying 
> it:
>
> self._knx_map = conf.copy()
> del self._knx_map['gateway_ip']
> del self._knx_map['gateway_port']
>
>
> Unfortunately, this is a shallow copy, so the deletions will delete not 
> only entries in _knx_map, but also in conf. This means weewxd will not 
> respond properly to a HUP reload 
> <http://www.weewx.com/docs/usersguide.htm#Running_directly>. You want a 
> deep copy:
>
> import weeutil.config
> ...
> self._knx_map = weeutil.config.deep_copy(conf)
> del self._knx_map['gateway_ip']
> del self._knx_map['gateway_port']
>
>
> 4. The check
>
> if self._gateway_ip is '0.0.0.0':
>
>
> is a check for *identity*. You want a check for equality:
>
> if self._gateway_ip == '0.0.0.0':
>
>
> 5. The install program uses
>
> from setup import ExtensionInstaller
>
>
> This has been replaced with
>
> from weecfg.extension import ExtensionInstaller
>
>
>
> All small things. Thanks for your contribution!
>
> -tk
>
>
> On Wed, Nov 4, 2020 at 1:17 AM Alexander Zeh <[email protected]> wrote:
>
>> Hi,
>>
>> i am new to this group and to participating in open source at all.
>> I added a new weewx service to submit weather data to knx bus (e.g. to 
>> control blinds) in an own repo: https://github.com/AZAZ78/weewx-knx.
>> I already created a wiki page in the weewx wiki with informations about 
>> it: https://github.com/weewx/weewx/wiki/knx.
>>
>> Can i also adapt the wiki entry page and add it to the list of service 
>> extensions or do i have to ask somebody for it?
>>
>> By the way, thanks to you all for this cool tool!
>>
>> Best regards
>> Alex
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "weewx-development" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected].
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/weewx-development/84462ba6-6a65-41da-b3b3-cbab3a494a34n%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/weewx-development/84462ba6-6a65-41da-b3b3-cbab3a494a34n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-development/7e03a804-bbaa-4a5b-9f33-c50e5df381ccn%40googlegroups.com.

Reply via email to