Compare commits

...
47 Commits
Author SHA1 Message Date
BlubbFish 968d781b70 some Changes 2019-02-11 16:45:41 +00:00
BlubbFish e9c9cb531d [NF] Change dependencys 2018-10-29 21:59:06 +00:00
BlubbFish 83cb131efe Zway-Bot [v1.7.2] Add Logging to some Modules, fixing a bug in overtaker (now it not removes every time all events, so only the latest event are watched)
[Utils] Fixing a bug if more than one argument with params
2018-10-02 14:53:59 +00:00
BlubbFish 26a0688dae Zway-Bot [v1.7.1] Tiny fix for nullpointer exception 2018-09-29 18:13:17 +00:00
BlubbFish 6807cd35ad Zway [v1.5.0] Throw Exception if 3 times failed to connect to Raspberry server, add 3 new commandlcasses to IgnoredClasses
Zway-Bot [v1.7.0] rewrite to Threaded Modules, edit service file for systemd
2018-09-29 12:15:37 +00:00
BlubbFish 877bce4d1a Rewrite of Eventhandleing, Threaded 2018-09-11 12:04:43 +00:00
BlubbFish 55f7b609b1 To new Structure 2018-08-02 21:49:22 +00:00
BlubbFish 6089a46d63 [NF] Moved CronJob, Overtaker, Statuspolling to Abstract Bot-Utils
[NF] Create NSI Script to produce exe
[NF] Add License.txt
2018-06-09 21:27:15 +00:00
BlubbFish 70bcf69b1b [NF] Add Bot-Utils and rewrite code 2018-06-07 20:49:54 +00:00
BlubbFish fc108773d9 [NF] Thread that checks if a MQTT Connection exists and if not reopen it
[NF] ConnectorDataMqtt now supports user and password
2018-06-05 16:46:56 +00:00
BlubbFish 92a6ba2b64 [BF] new try 2018-06-02 19:38:56 +00:00
BlubbFish 57daf12ed4 [BF] new try 2018-06-02 19:36:32 +00:00
BlubbFish cabcce03b3 [BF] new try 2018-06-02 19:32:20 +00:00
BlubbFish a9c77c6614 [BF] Fixing Bug in after installation script 2018-06-02 19:08:05 +00:00
BlubbFish 1c84703ac6 [BF] Making service linux running 2018-06-02 18:41:21 +00:00
BlubbFish 25e1e5165d 2018-06-02 17:14:42 +00:00
BlubbFish a76234f43d 2018-06-01 18:23:30 +00:00
BlubbFish a3afadd5f5 [NF] Move 2018-05-31 18:03:57 +00:00
BlubbFish 002b3cf338 [NF] Logrotate 2018-05-29 20:07:50 +00:00
BlubbFish a7895ef59a 2018-05-29 16:15:17 +00:00
BlubbFish 852a096f1d [NF] Now sould dedect Strg+c on Linux 2018-05-15 20:52:54 +00:00
BlubbFish 69030796f5 [BF] Fixinig installations dpkg script 2018-05-15 19:04:19 +00:00
BlubbFish 19d92c8cac [BF] Fixinig installations dpkg script 2018-05-15 18:59:32 +00:00
BlubbFish c792ea20ad Utils.csproj
[NF] Programmlogger added (v1.1.0)
[NF] Utils fixing tiny issues

Zway-Bot.csproj
[NF] changes Topics without beginning /
[NF] Using programmlogger (v1.4.0)
2018-05-15 18:49:03 +00:00
BlubbFish 611205e78f [BF] Fixing Issue with Math.Abs(l) 2018-05-12 12:36:32 +00:00
BlubbFish 4be8bb72f4 [BF] Some sensors make wrong measurements near 0 not exactly 0, so ABS(value) >= 0.1 is alse false 2018-05-10 06:26:39 +00:00
BlubbFish 76cb025606 [NF] Cleaning up
[NF] Create Debian Package
2018-05-08 17:25:39 +00:00
BlubbFish aa84aa0539 [BF] BOM from Settings file removed 2018-05-08 07:39:13 +00:00
BlubbFish 04f43b95ff [BF] Fixing Senml
[NF] Senml now has a configure option to setup the guid
[NF] Zway-Bot now listen on /exit
[NF] Implment searchpath for Zway-Bot (/etc/zwaybot and %appdata%/zwaybot)
2018-05-07 16:52:24 +00:00
BlubbFish a1009b5293 [NF] Now creating correct Senml for Linksmart 2018-05-07 14:02:57 +00:00
BlubbFish 91a05f882e [NF] Create Senml Messages for Linksmart 2018-05-03 14:43:50 +00:00
BlubbFish 74d270b6d2 [NF] Create Senml Messages for Linksmart 2018-05-03 14:39:08 +00:00
BlubbFish 200420c9b0 [NF] Create Senml Messages for Linksmart 2018-05-03 14:35:02 +00:00
BlubbFish acf5cea593 [DW] Flex4Grid deleted
[NF] BosMon Mqtt Plugin created
2018-03-31 20:42:28 +00:00
BlubbFish 307f03c7c0 [NF] v1.3.6.0 Better levelcheck and Alarmsensor added 2018-01-01 02:09:55 +00:00
BlubbFish 32b4daf3fb [BF] v1.3.5.3 Change Level to numeric and create State for Bollean values, because telegraf only parse numeric 2017-12-25 18:11:01 +00:00
BlubbFish 55e88f7b45 [[BF] v1.3.5.2 Check to avoid megapeaks in data now also for temperature 2017-12-24 10:43:58 +00:00
BlubbFish 8baef3b2b5 [BF] v1.3.5.1 Check to avoid megapeaks in Data 2017-12-23 22:37:36 +00:00
BlubbFish 80baca45e5 [NF] v.1.3 add possability to modify the config over mqtt 2017-12-22 22:13:28 +00:00
BlubbFish 75eac65510 [BF] v1.3.4.0 Fixing Json Names
[NF] v1.2.2.0 Mqtt can now get and set values
2017-12-19 20:18:30 +00:00
BlubbFish 44b8daa325 [BF] v.1.3.3 fixing polling once bug 2017-12-19 17:33:31 +00:00
BlubbFish 2cd2c7c02e [BF] v1.3.1.0 Forgot some settings, now configuration setting also works again 2017-12-18 16:02:18 +00:00
BlubbFish 33b1b6527c [NF] Tiny fix for mqtt 2017-12-17 21:53:16 +00:00
BlubbFish 9e60264d7d [NF] v1.3.0.0 Adding Status Polling and Mqtt (not compelete)
[NF] Able to force loading modules, so dependencys are ok
[NF] Cleanup because its now easyer to implement Zway
2017-12-17 20:09:28 +00:00
BlubbFish c96b2393d3 [BF] v.1.2.1.1 Next try to emulate F4G Events 2017-12-09 12:33:15 +00:00
BlubbFish 5fa97ea82b [NF] v1.1.2 Now complete Emulation of F4G Node
[NF] Possibility to attach internal cron events
2017-12-08 19:30:29 +00:00
BlubbFish 74027d705d [NF] Filter topics if usefull 2017-12-05 23:22:33 +00:00
55 changed files with 1212 additions and 636 deletions
+5
View File
@@ -0,0 +1,5 @@
/.vs
/Zway-Bot/obj
/Zway-Bot/bin/Debug
/Zway-Bot/bin/Release/*.pdb
/Zway-Bot/bin/Release/output.log
+362
View File
@@ -0,0 +1,362 @@
Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International Creative
Commons Corporation ("Creative Commons") is not a law firm and does not provide
legal services or legal advice. Distribution of Creative Commons public licenses
does not create a lawyer-client or other relationship. Creative Commons makes
its licenses and related information available on an "as-is" basis. Creative
Commons gives no warranties regarding its licenses, any material licensed
under their terms and conditions, or any related information. Creative Commons
disclaims all liability for damages resulting from their use to the fullest
extent possible.
Using Creative Commons Public Licenses
Creative Commons public licenses provide a standard set of terms and conditions
that creators and other rights holders may use to share original works of
authorship and other material subject to copyright and certain other rights
specified in the public license below. The following considerations are for
informational purposes only, are not exhaustive, and do not form part of our
licenses.
Considerations for licensors: Our public licenses are intended for use by
those authorized to give the public permission to use material in ways otherwise
restricted by copyright and certain other rights. Our licenses are irrevocable.
Licensors should read and understand the terms and conditions of the license
they choose before applying it. Licensors should also secure all rights necessary
before applying our licenses so that the public can reuse the material as
expected. Licensors should clearly mark any material not subject to the license.
This includes other CC-licensed material, or material used under an exception
or limitation to copyright. More considerations for licensors : wiki.creativecommons.org/Considerations_for_licensors
Considerations for the public: By using one of our public licenses, a licensor
grants the public permission to use the licensed material under specified
terms and conditions. If the licensor's permission is not necessary for any
reasonfor example, because of any applicable exception or limitation to copyrightthen
that use is not regulated by the license. Our licenses grant only permissions
under copyright and certain other rights that a licensor has authority to
grant. Use of the licensed material may still be restricted for other reasons,
including because others have copyright or other rights in the material. A
licensor may make special requests, such as asking that all changes be marked
or described. Although not required by our licenses, you are encouraged to
respect those requests where reasonable. More considerations for the public
: wiki.creativecommons.org/Considerations_for_licensees
Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International Public
License
By exercising the Licensed Rights (defined below), You accept and agree to
be bound by the terms and conditions of this Creative Commons Attribution-NonCommercial-ShareAlike
4.0 International Public License ("Public License"). To the extent this Public
License may be interpreted as a contract, You are granted the Licensed Rights
in consideration of Your acceptance of these terms and conditions, and the
Licensor grants You such rights in consideration of benefits the Licensor
receives from making the Licensed Material available under these terms and
conditions.
Section 1 Definitions.
a. Adapted Material means material subject to Copyright and Similar Rights
that is derived from or based upon the Licensed Material and in which the
Licensed Material is translated, altered, arranged, transformed, or otherwise
modified in a manner requiring permission under the Copyright and Similar
Rights held by the Licensor. For purposes of this Public License, where the
Licensed Material is a musical work, performance, or sound recording, Adapted
Material is always produced where the Licensed Material is synched in timed
relation with a moving image.
b. Adapter's License means the license You apply to Your Copyright and Similar
Rights in Your contributions to Adapted Material in accordance with the terms
and conditions of this Public License.
c. BY-NC-SA Compatible License means a license listed at creativecommons.org/compatiblelicenses,
approved by Creative Commons as essentially the equivalent of this Public
License.
d. Copyright and Similar Rights means copyright and/or similar rights closely
related to copyright including, without limitation, performance, broadcast,
sound recording, and Sui Generis Database Rights, without regard to how the
rights are labeled or categorized. For purposes of this Public License, the
rights specified in Section 2(b)(1)-(2) are not Copyright and Similar Rights.
e. Effective Technological Measures means those measures that, in the absence
of proper authority, may not be circumvented under laws fulfilling obligations
under Article 11 of the WIPO Copyright Treaty adopted on December 20, 1996,
and/or similar international agreements.
f. Exceptions and Limitations means fair use, fair dealing, and/or any other
exception or limitation to Copyright and Similar Rights that applies to Your
use of the Licensed Material.
g. License Elements means the license attributes listed in the name of a Creative
Commons Public License. The License Elements of this Public License are Attribution,
NonCommercial, and ShareAlike.
h. Licensed Material means the artistic or literary work, database, or other
material to which the Licensor applied this Public License.
i. Licensed Rights means the rights granted to You subject to the terms and
conditions of this Public License, which are limited to all Copyright and
Similar Rights that apply to Your use of the Licensed Material and that the
Licensor has authority to license.
j. Licensor means the individual(s) or entity(ies) granting rights under this
Public License.
k. NonCommercial means not primarily intended for or directed towards commercial
advantage or monetary compensation. For purposes of this Public License, the
exchange of the Licensed Material for other material subject to Copyright
and Similar Rights by digital file-sharing or similar means is NonCommercial
provided there is no payment of monetary compensation in connection with the
exchange.
l. Share means to provide material to the public by any means or process that
requires permission under the Licensed Rights, such as reproduction, public
display, public performance, distribution, dissemination, communication, or
importation, and to make material available to the public including in ways
that members of the public may access the material from a place and at a time
individually chosen by them.
m. Sui Generis Database Rights means rights other than copyright resulting
from Directive 96/9/EC of the European Parliament and of the Council of 11
March 1996 on the legal protection of databases, as amended and/or succeeded,
as well as other essentially equivalent rights anywhere in the world.
n. You means the individual or entity exercising the Licensed Rights under
this Public License. Your has a corresponding meaning.
Section 2 Scope.
a. License grant.
1. Subject to the terms and conditions of this Public License, the Licensor
hereby grants You a worldwide, royalty-free, non-sublicensable, non-exclusive,
irrevocable license to exercise the Licensed Rights in the Licensed Material
to:
A. reproduce and Share the Licensed Material, in whole or in part, for NonCommercial
purposes only; and
B. produce, reproduce, and Share Adapted Material for NonCommercial purposes
only.
2. Exceptions and Limitations. For the avoidance of doubt, where Exceptions
and Limitations apply to Your use, this Public License does not apply, and
You do not need to comply with its terms and conditions.
3. Term. The term of this Public License is specified in Section 6(a).
4. Media and formats; technical modifications allowed. The Licensor authorizes
You to exercise the Licensed Rights in all media and formats whether now known
or hereafter created, and to make technical modifications necessary to do
so. The Licensor waives and/or agrees not to assert any right or authority
to forbid You from making technical modifications necessary to exercise the
Licensed Rights, including technical modifications necessary to circumvent
Effective Technological Measures. For purposes of this Public License, simply
making modifications authorized by this Section 2(a)(4) never produces Adapted
Material.
5. Downstream recipients.
A. Offer from the Licensor Licensed Material. Every recipient of the Licensed
Material automatically receives an offer from the Licensor to exercise the
Licensed Rights under the terms and conditions of this Public License.
B. Additional offer from the Licensor Adapted Material. Every recipient
of Adapted Material from You automatically receives an offer from the Licensor
to exercise the Licensed Rights in the Adapted Material under the conditions
of the Adapter's License You apply.
C. No downstream restrictions. You may not offer or impose any additional
or different terms or conditions on, or apply any Effective Technological
Measures to, the Licensed Material if doing so restricts exercise of the Licensed
Rights by any recipient of the Licensed Material.
6. No endorsement. Nothing in this Public License constitutes or may be construed
as permission to assert or imply that You are, or that Your use of the Licensed
Material is, connected with, or sponsored, endorsed, or granted official status
by, the Licensor or others designated to receive attribution as provided in
Section 3(a)(1)(A)(i).
b. Other rights.
1. Moral rights, such as the right of integrity, are not licensed under this
Public License, nor are publicity, privacy, and/or other similar personality
rights; however, to the extent possible, the Licensor waives and/or agrees
not to assert any such rights held by the Licensor to the limited extent necessary
to allow You to exercise the Licensed Rights, but not otherwise.
2. Patent and trademark rights are not licensed under this Public License.
3. To the extent possible, the Licensor waives any right to collect royalties
from You for the exercise of the Licensed Rights, whether directly or through
a collecting society under any voluntary or waivable statutory or compulsory
licensing scheme. In all other cases the Licensor expressly reserves any right
to collect such royalties, including when the Licensed Material is used other
than for NonCommercial purposes.
Section 3 License Conditions.
Your exercise of the Licensed Rights is expressly made subject to the following
conditions.
a. Attribution.
1. If You Share the Licensed Material (including in modified form), You must:
A. retain the following if it is supplied by the Licensor with the Licensed
Material:
i. identification of the creator(s) of the Licensed Material and any others
designated to receive attribution, in any reasonable manner requested by the
Licensor (including by pseudonym if designated);
ii. a copyright notice;
iii. a notice that refers to this Public License;
iv. a notice that refers to the disclaimer of warranties;
v. a URI or hyperlink to the Licensed Material to the extent reasonably practicable;
B. indicate if You modified the Licensed Material and retain an indication
of any previous modifications; and
C. indicate the Licensed Material is licensed under this Public License, and
include the text of, or the URI or hyperlink to, this Public License.
2. You may satisfy the conditions in Section 3(a)(1) in any reasonable manner
based on the medium, means, and context in which You Share the Licensed Material.
For example, it may be reasonable to satisfy the conditions by providing a
URI or hyperlink to a resource that includes the required information.
3. If requested by the Licensor, You must remove any of the information required
by Section 3(a)(1)(A) to the extent reasonably practicable.
b. ShareAlike.In addition to the conditions in Section 3(a), if You Share
Adapted Material You produce, the following conditions also apply.
1. The Adapter's License You apply must be a Creative Commons license with
the same License Elements, this version or later, or a BY-NC-SA Compatible
License.
2. You must include the text of, or the URI or hyperlink to, the Adapter's
License You apply. You may satisfy this condition in any reasonable manner
based on the medium, means, and context in which You Share Adapted Material.
3. You may not offer or impose any additional or different terms or conditions
on, or apply any Effective Technological Measures to, Adapted Material that
restrict exercise of the rights granted under the Adapter's License You apply.
Section 4 Sui Generis Database Rights.
Where the Licensed Rights include Sui Generis Database Rights that apply to
Your use of the Licensed Material:
a. for the avoidance of doubt, Section 2(a)(1) grants You the right to extract,
reuse, reproduce, and Share all or a substantial portion of the contents of
the database for NonCommercial purposes only;
b. if You include all or a substantial portion of the database contents in
a database in which You have Sui Generis Database Rights, then the database
in which You have Sui Generis Database Rights (but not its individual contents)
is Adapted Material, including for purposes of Section 3(b); and
c. You must comply with the conditions in Section 3(a) if You Share all or
a substantial portion of the contents of the database.
For the avoidance of doubt, this Section 4 supplements and does not replace
Your obligations under this Public License where the Licensed Rights include
other Copyright and Similar Rights.
Section 5 Disclaimer of Warranties and Limitation of Liability.
a. Unless otherwise separately undertaken by the Licensor, to the extent possible,
the Licensor offers the Licensed Material as-is and as-available, and makes
no representations or warranties of any kind concerning the Licensed Material,
whether express, implied, statutory, or other. This includes, without limitation,
warranties of title, merchantability, fitness for a particular purpose, non-infringement,
absence of latent or other defects, accuracy, or the presence or absence of
errors, whether or not known or discoverable. Where disclaimers of warranties
are not allowed in full or in part, this disclaimer may not apply to You.
b. To the extent possible, in no event will the Licensor be liable to You
on any legal theory (including, without limitation, negligence) or otherwise
for any direct, special, indirect, incidental, consequential, punitive, exemplary,
or other losses, costs, expenses, or damages arising out of this Public License
or use of the Licensed Material, even if the Licensor has been advised of
the possibility of such losses, costs, expenses, or damages. Where a limitation
of liability is not allowed in full or in part, this limitation may not apply
to You.
c. The disclaimer of warranties and limitation of liability provided above
shall be interpreted in a manner that, to the extent possible, most closely
approximates an absolute disclaimer and waiver of all liability.
Section 6 Term and Termination.
a. This Public License applies for the term of the Copyright and Similar Rights
licensed here. However, if You fail to comply with this Public License, then
Your rights under this Public License terminate automatically.
b. Where Your right to use the Licensed Material has terminated under Section
6(a), it reinstates:
1. automatically as of the date the violation is cured, provided it is cured
within 30 days of Your discovery of the violation; or
2. upon express reinstatement by the Licensor.
For the avoidance of doubt, this Section 6(b) does not affect any right the
Licensor may have to seek remedies for Your violations of this Public License.
c. For the avoidance of doubt, the Licensor may also offer the Licensed Material
under separate terms or conditions or stop distributing the Licensed Material
at any time; however, doing so will not terminate this Public License.
d. Sections 1, 5, 6, 7, and 8 survive termination of this Public License.
Section 7 Other Terms and Conditions.
a. The Licensor shall not be bound by any additional or different terms or
conditions communicated by You unless expressly agreed.
b. Any arrangements, understandings, or agreements regarding the Licensed
Material not stated herein are separate from and independent of the terms
and conditions of this Public License.
Section 8 Interpretation.
a. For the avoidance of doubt, this Public License does not, and shall not
be interpreted to, reduce, limit, restrict, or impose conditions on any use
of the Licensed Material that could lawfully be made without permission under
this Public License.
b. To the extent possible, if any provision of this Public License is deemed
unenforceable, it shall be automatically reformed to the minimum extent necessary
to make it enforceable. If the provision cannot be reformed, it shall be severed
from this Public License without affecting the enforceability of the remaining
terms and conditions.
c. No term or condition of this Public License will be waived and no failure
to comply consented to unless expressly agreed to by the Licensor.
d. Nothing in this Public License constitutes or may be interpreted as a limitation
upon, or waiver of, any privileges and immunities that apply to the Licensor
or You, including from the legal processes of any jurisdiction or authority.
Creative Commons is not a party to its public licenses. Notwithstanding, Creative
Commons may elect to apply one of its public licenses to material it publishes
and in those instances will be considered the "Licensor." The text of the
Creative Commons public licenses is dedicated to the public domain under the
CC0 Public Domain Dedication. Except for the limited purpose of indicating
that material is shared under a Creative Commons public license or as otherwise
permitted by the Creative Commons policies published at creativecommons.org/policies,
Creative Commons does not authorize the use of the trademark "Creative Commons"
or any other trademark or logo of Creative Commons without its prior written
consent including, without limitation, in connection with any unauthorized
modifications to any of its public licenses or any other arrangements, understandings,
or agreements concerning use of licensed material. For the avoidance of doubt,
this paragraph does not form part of the public licenses.
Creative Commons may be contacted at creativecommons.org.
+2
View File
@@ -0,0 +1,2 @@
# Zway-Bot
+29 -5
View File
@@ -11,7 +11,15 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Utils", "..\Utils\Utils\Uti
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Utils-IoT", "..\Utils\IoT\Utils-IoT.csproj", "{B870E4D5-6806-4A0B-B233-8907EEDC5AFC}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Utils-IoT", "..\Utils\IoT\Utils-IoT.csproj", "{B870E4D5-6806-4A0B-B233-8907EEDC5AFC}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConnectorDataMosquitto", "..\Utils\IoT\Connector\Data\Mosquitto\ConnectorDataMosquitto.csproj", "{39235FAD-BA9D-4B51-82FC-6969967BEAE9}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConnectorDataMqtt", "..\Utils\IoT\Connector\Data\Mqtt\ConnectorDataMqtt.csproj", "{EE6C8F68-ED46-4C1C-ABDD-CFCDF75104F2}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Iot-Interfaces", "..\Utils\IoT\Interfaces\Iot-Interfaces.csproj", "{4DAADA29-C600-4CF3-8AD3-9C97C8D7F632}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "litjson_4.7.1", "..\Librarys\litjson\litjson\litjson_4.7.1.csproj", "{91A14CD2-2940-4500-8193-56D37EDDDBAA}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "M2Mqtt_4.7.1", "..\Librarys\mqtt\M2Mqtt\M2Mqtt_4.7.1.csproj", "{A11AEF5A-B246-4FE8-8330-06DB73CC8074}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Bot-Utils", "..\Utils\Bot-Utils\Bot-Utils.csproj", "{BB7BFCB5-3DB0-49E1-802A-3CE3EECC59F9}"
EndProject EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -35,10 +43,26 @@ Global
{B870E4D5-6806-4A0B-B233-8907EEDC5AFC}.Debug|Any CPU.Build.0 = Debug|Any CPU {B870E4D5-6806-4A0B-B233-8907EEDC5AFC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B870E4D5-6806-4A0B-B233-8907EEDC5AFC}.Release|Any CPU.ActiveCfg = Release|Any CPU {B870E4D5-6806-4A0B-B233-8907EEDC5AFC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B870E4D5-6806-4A0B-B233-8907EEDC5AFC}.Release|Any CPU.Build.0 = Release|Any CPU {B870E4D5-6806-4A0B-B233-8907EEDC5AFC}.Release|Any CPU.Build.0 = Release|Any CPU
{39235FAD-BA9D-4B51-82FC-6969967BEAE9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {EE6C8F68-ED46-4C1C-ABDD-CFCDF75104F2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{39235FAD-BA9D-4B51-82FC-6969967BEAE9}.Debug|Any CPU.Build.0 = Debug|Any CPU {EE6C8F68-ED46-4C1C-ABDD-CFCDF75104F2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{39235FAD-BA9D-4B51-82FC-6969967BEAE9}.Release|Any CPU.ActiveCfg = Release|Any CPU {EE6C8F68-ED46-4C1C-ABDD-CFCDF75104F2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{39235FAD-BA9D-4B51-82FC-6969967BEAE9}.Release|Any CPU.Build.0 = Release|Any CPU {EE6C8F68-ED46-4C1C-ABDD-CFCDF75104F2}.Release|Any CPU.Build.0 = Release|Any CPU
{4DAADA29-C600-4CF3-8AD3-9C97C8D7F632}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4DAADA29-C600-4CF3-8AD3-9C97C8D7F632}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4DAADA29-C600-4CF3-8AD3-9C97C8D7F632}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4DAADA29-C600-4CF3-8AD3-9C97C8D7F632}.Release|Any CPU.Build.0 = Release|Any CPU
{91A14CD2-2940-4500-8193-56D37EDDDBAA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{91A14CD2-2940-4500-8193-56D37EDDDBAA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{91A14CD2-2940-4500-8193-56D37EDDDBAA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{91A14CD2-2940-4500-8193-56D37EDDDBAA}.Release|Any CPU.Build.0 = Release|Any CPU
{A11AEF5A-B246-4FE8-8330-06DB73CC8074}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A11AEF5A-B246-4FE8-8330-06DB73CC8074}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A11AEF5A-B246-4FE8-8330-06DB73CC8074}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A11AEF5A-B246-4FE8-8330-06DB73CC8074}.Release|Any CPU.Build.0 = Release|Any CPU
{BB7BFCB5-3DB0-49E1-802A-3CE3EECC59F9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BB7BFCB5-3DB0-49E1-802A-3CE3EECC59F9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BB7BFCB5-3DB0-49E1-802A-3CE3EECC59F9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BB7BFCB5-3DB0-49E1-802A-3CE3EECC59F9}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
-53
View File
@@ -1,53 +0,0 @@
using System;
namespace ZwayBot {
public class CronEvent : ModulEventArgs {
public CronEvent() {
}
public CronEvent(String addr, String prop, String value) {
this.Address = addr;
this.Property = prop;
this.Value = value;
this.Source = "Cronjob";
}
}
public class OvertakerEvent : ModulEventArgs {
public OvertakerEvent() {
}
public OvertakerEvent(String addr, String prop, String value) {
this.Address = addr;
this.Property = prop;
this.Value = value;
this.Source = "Overtaker";
}
}
public class Flex4gridEvent : ModulEventArgs {
public Flex4gridEvent() {
}
public Flex4gridEvent(String topic, String text) {
this.Address = topic;
this.Value = text;
this.Source = "Flex4Grid";
}
public override String ToString() {
return this.Source + ": on " + this.Address + " set " + this.Value;
}
}
public class ModulEventArgs : EventArgs {
public ModulEventArgs() {
}
public String Address { get; protected set; }
public String Property { get; protected set; }
public String Value { get; protected set; }
public String Source { get; protected set; }
public override String ToString() {
return this.Source + ": " + this.Address + " set " + this.Property + " to " + this.Value;
}
}
}
-54
View File
@@ -1,54 +0,0 @@
using System;
using System.Reflection;
namespace ZwayBot {
class Helper {
public static void SetProperty(Object o, String name, String value) {
PropertyInfo prop = o.GetType().GetProperty(name);
if (prop.CanWrite) {
if (prop.PropertyType == typeof(Boolean) && Boolean.TryParse(value, out Boolean vb)) {
prop.SetValue(o, vb);
} else if (prop.PropertyType == typeof(Int32) && Int32.TryParse(value, out Int32 v32)) {
prop.SetValue(o, v32);
} else if (prop.PropertyType == typeof(Single) && Single.TryParse(value, out Single vs)) {
prop.SetValue(o, vs);
} else if (prop.PropertyType == typeof(Int64) && Int64.TryParse(value, out Int64 v64)) {
prop.SetValue(o, v64);
}
}
}
public static Boolean HasProperty(Object o, String type) {
Type t = o.GetType();
foreach (PropertyInfo item in t.GetProperties()) {
if (item.Name == type) {
return true;
}
}
return false;
}
internal static Object GetProperty(Object o, String name) {
PropertyInfo prop = o.GetType().GetProperty(name);
if(prop.CanRead) {
return prop.GetValue(o);
}
return null;
}
internal static Boolean HasInterface(Object o, String type) {
Type t = o.GetType();
foreach (Type item in t.GetInterfaces()) {
if(item.Name == type) {
return true;
}
}
return false;
}
internal static void WriteError(String text) {
Console.ForegroundColor = ConsoleColor.Red;
Console.Error.WriteLine("ERROR: " + text);
Console.ResetColor();
}
}
}
+108
View File
@@ -0,0 +1,108 @@
Namensnennung-Nicht kommerziell-Share Alike 4.0 International
Die Creative Commons Corporation (“Creative Commons”) ist keine Rechtsanwaltskanzlei und bietet weder Rechtsdienstleistungen noch Rechtsberatung. Die Verbreitung von Creative Commons Public Licenses führt zu keinem Mandatsverhältnis und keiner sonstigen Rechtsbeziehung. Creative Commons macht seine Lizenzen und die dazugehörigen Informationen so zugänglich, wie sie sind. Creative Commons übernimmt keinerlei Gewährleistung hinsichtlich seiner Lizenzen, jedweder unter deren Bedingungen lizenzierter Materialien oder darauf bezogener Informationen. Creative Commons schließt jegliche Haftung für Schäden, die aus ihrer Verwendung resultieren, so weit wie möglich aus.
Verwendung der Creative Commons Public Licenses
Creative Commons Public Licenses sind standardisierte Zusammenstellungen rechtlicher Bedingungen, die Urheber und andere Rechteinhaber verwenden können, um ihre selbst geschaffenen Werke und andere Materialien, die urheberrechtlich oder durch bestimmte andere Rechte geschützt sind, die unten in der Public License genauer benannt werden, zur Nutzung freizugeben. Die folgenden Überlegungen haben lediglich informativen Charakter, sind keineswegs vollständig und nicht Teil unserer Lizenzen.
Überlegungen für Lizenzgeber: Unsere Public Licenses sind zur Verwendung durch diejenigen gedacht, die rechtlich befugt sind, der Allgemeinheit solche Nutzungen von Material zu erlauben, die sonst durch das Urheberrecht oder bestimmte andere Rechte untersagt wären. Unsere Lizenzen sind unwiderruflich. Lizenzgeber sollten die Bedingungen der Lizenz, die sie auswählen, lesen und verstehen, bevor sie die Lizenz verwenden. Lizenzgeber sollten zudem alle erforderlichen Rechte einholen, die für die Verwendung unserer Lizenzen notwendig sind, damit die Allgemeinheit das lizenzierte Material wie erwartet nutzen kann. Lizenzgeber sollten jegliches Material, für welches die Lizenz nicht gilt, klar kenntlich machen. Das gilt auch für anderes CC-lizenziertes Material und für Material, das gemäß einer urheberrechtlichen Beschränkung oder Ausnahme genutzt wird. Weitere Überlegungen für Lizenzgeber finden Sie im Creative Commons Wiki (in Englisch).
Überlegungen für die Allgemeinheit: Durch die Verwendung einer unserer Public Licenses gibt ein Lizenzgeber der Allgemeinheit die Erlaubnis, das lizenzierte Material unter bestimmten Bedingungen zu nutzen. Falls die Erlaubnis des Lizenzgebers aus irgendwelchen Gründen gar nicht erforderlich ist beispielsweise wegen einer urheberrechtlichen Ausnahme oder Beschränkung dann wird die entsprechende Nutzung auch nicht durch die Lizenz geregelt. Die Erlaubnisse in unseren Lizenzen beziehen sich nur auf das Urheberrecht und bestimmte andere Rechte, hinsichtlich derer der Lizenzgeber Erlaubnisse geben kann. Die Nutzung des lizenzierten Materials kann aber dennoch aus anderen Gründen untersagt sein, etwa weil Dritte Urheber- oder andere Rechte am Material haben. Ein Lizenzgeber kann auch besondere Wünsche haben, etwa indem er dazu auffordert, alle Veränderungen zu kennzeichnen oder zu beschreiben. Obwohl dies dann nicht verpflichtend im Sinne unserer Lizenzen ist, sollten Sie sich bemühen, derlei Wünschen nach Möglichkeit nachzukommen. Weitere Überlegungen für die Allgemeinheit finden Sie im Creative Commons Wiki (in Englisch).
Creative Commons Namensnennung-Nicht kommerziell-Share Alike 4.0 International Public License
Durch die Ausübung der lizenzierten Rechte (wie unten definiert) erklären Sie sich rechtsverbindlich mit den Bedingungen dieser Creative Commons Namensnennung Nicht kommerziell Share Alike 4.0 International Public License (“Public License”) einverstanden. Soweit die vorliegende Public License als Lizenzvertrag anzusehen ist, gewährt Ihnen der Lizenzgeber die in der Public License genannten lizenzierten Rechte im Gegenzug dafür, dass Sie die Lizenzbedingungen akzeptieren, und gewährt Ihnen die entsprechenden Rechte in Hinblick auf Vorteile, die der Lizenzgeber durch das Verfügbarmachen des lizenzierten Materials unter diesen Bedingungen hat.
Abschnitt 1 Definitionen
Abgewandeltes Material bezeichnet Material, welches durch Urheberrechte oder ähnliche Rechte geschützt ist und vom lizenzierten Material abgeleitet ist oder darauf aufbaut und in welchem das lizenzierte Material übersetzt, verändert, umarrangiert, umgestaltet oder anderweitig modifiziert in einer Weise enthalten ist, die aufgrund des Urheberrechts oder ähnlicher Rechte des Lizenzgebers eine Zustimmung erfordert. Im Sinne der vorliegenden Public License entsteht immer abgewandeltes Material, wenn das lizenzierte Material ein Musikwerk, eine Darbietung oder eine Tonaufnahme ist und zur Vertonung von Bewegtbildern verwendet wird.
Abwandlungslizenz bezeichnet die Lizenz, die Sie in Bezug auf Ihr Urheberrecht oder ähnliche Rechte an Ihren Beiträgen zum abgewandelten Material in Übereinstimmng mit den Bedingungen der vorliegenden Public License erteilen.
BY-NC-SA-kompatible Lizenz bezeichnet eine unter creativecommons.org/compatiblelicenses genannte Lizenz, die Creative Commons als der vorliegenden Public License im Wesentlichen gleichwertig anerkannt hat.
Urheberrecht und ähnliche Rechte bezeichnet das Urheberrecht und/oder ähnliche, dem Urheberrecht eng verwandte Rechte, einschließlich insbesondere des Rechts des ausübenden Künstlers, des Rechts zur Sendung, zur Tonaufnahme und des Sui-generis-Datenbankrechts, unabhängig davon, wie diese Rechte genannt oder kategorisiert werden. Im Sinne der vorliegenden Public License werden die in Abschnitt 2(b)(1)-(2) aufgeführten Rechte nicht als Urheberrecht und ähnliche Rechte angesehen.
Wirksame technische Schutzmaßnahmen bezeichnet solche Maßnahmen, die gemäß gesetzlichen Regelungen auf der Basis des Artikels 11 des WIPO Copyright Treaty vom 20. Dezember 1996 und/oder ähnlicher internationaler Vereinbarungen ohne entsprechende Erlaubnis nicht umgangen werden dürfen.
Ausnahmen und Beschränkungen bezeichnet Fair Use, Fair Dealing und/oder jegliche andere Ausnahme oder Beschränkung des Urheberrechts oder ähnlicher Rechte, die auf Ihre Nutzung des lizenzierten Materials Anwendung findet.
Lizenzelemente bezeichnet die Lizenzeigenschaften, die in der Bezeichnung einer Creative Commons Public License aufgeführt werden. Die Lizenzelemente der vorliegenden Public License sind Namensnennung, Nicht kommerziell und Share Alike.
Lizenziertes Material bezeichnet das Werk der Literatur oder Kunst, die Datenbank oder das sonstige Material, welches der Lizenzgeber unter die vorliegende Public License gestellt hat.
Lizenzierte Rechte bezeichnet die Ihnen unter den Bedingungen der vorliegenden Public License gewährten Rechte, welche auf solche Urheberrechte und ähnlichen Rechte beschränkt sind, die Ihre Nutzung des lizenzierten Materials betreffen und die der Lizenzgeber zu lizenzieren berechtigt ist.
Lizenzgeber bezeichnet die natürliche(n) oder juristische(n) Person(en), die unter der vorliegenden Public License Rechte gewährt (oder gewähren).
Nicht kommerziell meint nicht vorrangig auf einen geschäftlichen Vorteil oder eine geldwerte Vergütung gerichtet. Der Austausch von lizenziertem Material gegen anderes unter Urheberrecht oder ähnlichen Rechten geschütztes Material durch digitales File-Sharing oder ähnliche Mittel ist nicht kommerziell im Sinne der vorliegenden Public License, sofern in Verbindung damit keine geldwerte Vergütung erfolgt.
Weitergabe meint, Material der Öffentlichkeit bereitzustellen durch beliebige Mittel oder Verfahren, die gemäß der lizenzierten Rechte Zustimmung erfordern, wie zum Beispiel Vervielfältigung, öffentliche Vorführung, öffentliche Darbietung, Vertrieb, Verbreitung, Wiedergabe oder Übernahme und öffentliche Zugänglichmachung bzw. Verfügbarmachung in solcher Weise, dass Mitglieder der Öffentlichkeit auf das Material von Orten und zu Zeiten ihrer Wahl zugreifen können.
Sui-generis Datenbankrechte bezeichnet Rechte, die keine Urheberrechte sind, sondern gegründet sind auf die Richtlinie 96/9/EG des Europäischen Parlaments und des Rates vom 11. März 1996 über den rechtlichen Schutz von Datenbanken in der jeweils gültigen Fassung bzw. deren Nachfolgeregelungen, sowie andere im Wesentlichen funktionsgleiche Rechte anderswo auf der Welt.
Sie bezeichnet die natürliche oder juristische Person, die von lizenzierten Rechten unter der vorliegenden Public License Gebrauch macht. Ihr bzw. Ihre hat die entsprechende Bedeutung.
Abschnitt 2 Umfang
Lizenzgewährung
Unter den Bedingungen der vorliegenden Public License gewährt der Lizenzgeber Ihnen eine weltweite, vergütungsfreie, nicht unterlizenzierbare, nicht-ausschließliche, unwiderrufliche Lizenz zur Ausübung der lizenzierten Rechte am lizenzierten Material, um:
das lizenzierte Material ganz oder in Teilen zu vervielfältigen und weiterzugeben, jedoch nur für nicht kommerzielle Zwecke; und
abgewandeltes Material zu erstellen, zu vervielfältigen und weiterzugeben, jedoch nur für nicht kommerzielle Zwecke.
Ausnahmen und Beschränkungen. Es sei klargestellt, dass, wo immer gesetzliche Ausnahmen und Beschränkungen auf Ihre Nutzung Anwendung finden, die vorliegende Public License nicht anwendbar ist und Sie insoweit ihre Bedingungen nicht einhalten müssen.
Laufzeit. Die Laufzeit der vorliegenden Public License wird in Abschnitt 6(a) geregelt.
Medien und Formate; Gestattung technischer Modifikationen. Der Lizenzgeber erlaubt Ihnen, die lizenzierten Rechte in allen bekannten und zukünftig entstehenden Medien und Formaten auszuüben und die dafür notwendigen technischen Modifikationen vorzunehmen. Der Lizenzgeber verzichtet auf jegliche und/oder versichert die Nichtausübung jeglicher Rechte und Befugnisse, Ihnen zu verbieten, technische Modifikationen vorzunehmen, die notwendig sind, um die lizenzierten Rechte ausüben zu können, einschließlich solcher, die zur Umgehung wirksamer technischer Schutzmaßnahmen erforderlich sind. Im Sinne der vorliegenden Public License entsteht kein abgewandeltes Material, soweit lediglich Modifikationen vorgenommen werden, die nach diesem Abschnitt 2(a)(4) zulässig sind.
Nachfolgende Empfänger
Angebot des Lizenzgebers Lizenziertes Material. Jeder Empfänger des lizenzierten Materials erhält automatisch ein Angebot des Lizenzgebers, die lizenzierten Rechte unter den Bedingungen der vorliegenden Public License auzuüben.
Zusätzliches Angebot des Lizenzgebers Abgewandeltes Material. Jeder, der abgewandeltes Material von Ihnen erhält, erhält automatisch vom Lizenzgeber ein Angebot, die lizenzierten Rechte am abgewandelten Material unter den Bedingungen der durch Sie vergebenen Abwandlungslizenz auszuüben.
Keine Beschränkungen für nachfolgende Empfänger. Sie dürfen keine zusätzlichen oder abweichenden Bedingungen fordern oder das lizenzierte Material mit solchen belegen oder darauf wirksame technische Maßnahmen anwenden, sofern dadurch die Ausübung der lizenzierten Rechte durch Empfänger des lizenzierten Materials eingeschränkt wird.
Inhaltliche Indifferenz. Die vorliegende Public License begründet nicht die Erlaubnis, zu behaupten oder den Eindruck zu erwecken, dass Sie oder Ihre Nutzung des lizenzierten Materials mit dem Lizenzgeber oder den Zuschreibungsempfängern gemäß Abschnitt 3(a)(1)(A)(i) in Verbindung stehen oder durch ihn gefördert, gutgeheißen oder offiziell anerkannt werden.
Sonstige Rechte
Urheberpersönlichkeitsrechte, wie etwa zum Schutz vor Werkentstellungen, werden durch die vorliegende Public License ebenso wenig mitlizenziert wie das Recht auf Privatheit, auf Datenschutz und/oder ähnliche Persönlichkeitsrechte; gleichwohl verzichtet der Lizenzgeber auf derlei Rechte bzw. ihre Durchsetzung, soweit dies für Ihre Ausübung der lizenzierten Rechte erforderlich und möglich ist, jedoch nicht darüber hinaus.
Patent- und Kennzeichenrechte werden durch die vorliegende Public License nicht lizenziert.
Soweit wie möglich verzichtet der Lizenzgeber auf Vergütung durch Sie für die Ausübung der lizenzierten Rechte, sowohl direkt als auch durch eine Verwertungsgesellschaft unter welchem freiwilligen oder abdingbaren gesetzlichen oder Pflichtlizenzmechanismus auch immer eingezogen. In allen übrigen Fällen behält sich der Lizenzgeber ausdrücklich jedes Recht vor, Vergütungen zu fordern, einschließlich für Nutzungen des lizenzierten Materials für andere als nicht kommerzielle Zwecke.
Abschnitt 3 Lizenzbedingungen
Ihre Ausübung der lizenzierten Rechte unterliegt ausdrücklich folgenden Bedingungen.
Namensnennung
Wenn Sie das lizenzierte Material weitergeben (auch in veränderter Form), müssen Sie:
die folgenden Angaben beibehalten, soweit sie vom Lizenzgeber dem lizenzierten Material beigefügt wurden:
die Bezeichnung der/des Ersteller(s) des lizenzierten Materials und anderer, die für eine Namensnennung vorgesehen sind (auch durch Pseudonym, falls angegeben), in jeder durch den Lizenzgeber verlangten Form, die angemessen ist;
einen Copyright-Vermerk;
einen Hinweis auf die vorliegende Public License;
einen Hinweis auf den Haftungsausschluss;
soweit vernünftigerweise praktikabel einen URI oder Hyperlink zum lizenzierten Material;
angeben, ob Sie das lizenzierte Material verändert haben, und alle vorherigen Änderungsangaben beibehalten; und
angeben, dass das lizenzierte Material unter der vorliegenden Public License steht, und deren Text oder URI oder einen Hyperlink darauf beifügen.
Sie dürfen die Bedingungen des Abschnitts 3(a)(1) in jeder angemessenen Form erfüllen, je nach Medium, Mittel und Kontext in bzw. mit dem Sie das lizenzierte Material weitergeben. Es kann zum Beispiel angemessen sein, die Bedingungen durch Angabe eines URI oder Hyperlinks auf eine Quelle zu erfüllen, die die erforderlichen Informationen enthält.
Falls der Lizenzgeber es verlangt, müssen Sie die gemäß Abschnitt 3(a)(1)(A) erforderlichen Informationen entfernen, soweit dies vernünftigerweise praktikabel ist.
Share Alike
Zusätzlich zu den Bedingungen in Abschnitt 3(a) gelten die folgenden Bedingungen, falls Sie abgewandeltes Material weitergeben, welches Sie selbst erstellt haben.
Die Abwandlungslizenz, die Sie vergeben, muss eine Creative-Commons-Lizenz der vorliegenden oder einer späteren Version mit den gleichen Lizenzelementen oder eine BY-NC-SA-kompatible Lizenz sein.
Sie müssen den Text oder einen URI oder Hyperlink auf die von Ihnen gewählte Abwandlungslizenz beifügen. Diese Bedingung dürfen Sie in jeder angemessenen Form erfüllen, je nach Medium, Mittel und Kontext in bzw. mit dem Sie abgewandeltes Material weitergeben.
Sie dürfen keine zusätzlichen oder abweichenden Bedingungen anbieten oder das abgewandelte Material mit solchen belegen oder darauf wirksame technische Maßnahmen anwenden, sofern dadurch die Ausübung der Rechte am abgewandelten Material eingeschränkt wird, die Sie unter der Abwandlungslizenz gewähren.
Abschnitt 4 Sui-generis-Datenbankrechte
Soweit die lizenzierten Rechte Sui-generis-Datenbankrechte beinhalten, die auf Ihre Nutzung des lizenzierten Materials Anwendung finden, gilt:
es sei klargestellt, dass Abschnitt 2(a)(1) Ihnen lediglich zu nicht kommerziellen Zwecken das Recht gewährt, die gesamten Inhalte der Datenbank oder wesentliche Teile davon zu entnehmen, weiterzuverwenden, zu vervielfältigen und weiterzugeben;
sofern Sie alle Inhalte der Datenbank oder wesentliche Teile davon in eine Datenbank aufnehmen, an der Sie Sui-generis-Datenbankrechte haben, dann gilt die Datenbank, an der Sie Sui-generis-Datenbankrechte haben (aber nicht ihre einzelnen Inhalte) als abgewandeltes Material, insbesondere in Bezug auf Abschnitt 3(b); und
Sie müssen die Bedingungen des Abschnitts 3(a) einhalten, wenn sie alle Datenbankinhalte oder wesentliche Teile davon weitergeben.
Es sei ferner klargestellt, dass dieser Abschnitt 4 Ihre Verpflichtungen aus der vorliegenden Public License nur ergänzt und nicht ersetzt, soweit die lizenzierten Rechte andere Urheberrechte oder ähnliche Rechte enthalten.
Abschnitt 5 Gewährleistungsausschluss und Haftungsbeschränkung
Sofern der Lizenzgeber nicht separat anderes erklärt und so weit wie möglich, bietet der Lizenzgeber das lizenzierte Material so wie es ist und verfügbar ist an und sagt in Bezug auf das lizenzierte Material keine bestimmten Eigenschaften zu, weder ausdrücklich noch konkludent oder anderweitig, und schließt jegliche Gewährleistung aus, einschließlich der gesetzlichen. Dies umfasst insbesondere das Freisein von Rechtsmängeln, Verkehrsfähigkeit, Eignung für einen bestimmten Zweck, Wahrung der Rechte Dritter, Freisein von (auch verdeckten) Sachmängeln, Richtigkeit und das Vorliegen oder Nichtvorliegen von Irrtümern, gleichviel ob sie bekannt, unbekannt oder erkennbar sind. Dort, wo Gewährleistungsausschlüsse ganz oder teilweise unzulässig sind, gilt der vorliegende Ausschluss möglicherweise für Sie nicht.
Soweit wie möglich, haftet der Lizenzgeber Ihnen gegenüber nach keinem rechtlichen Konstrukt (einschließlich insbesondere Fahrlässigkeit) oder anderweitig für irgendwelche direkten, speziellen, indirekten, zufälligen, Folge-, Straf- exemplarischen oder anderen Verluste, Kosten, Aufwendungen oder Schäden, die sich aus der vorliegenden Public License oder der Nutzung des lizenzierten Materials ergeben, selbst wenn der Lizenzgeber auf die Möglichkeit solcher Verluste, Kosten, Aufwendungen oder Schäden hingewiesen wurde. Dort, wo Haftungsbeschränkungen ganz oder teilweise unzulässig sind, gilt die vorliegende Beschränkung möglicherweise für Sie nicht.
Der Gewährleistungsausschluss und die Haftungsbeschränkung oben sollen so ausgelegt werden, dass sie soweit wie möglich einem absoluten Haftungs- und Gewährleistungsausschluss nahe kommen.
Abschnitt 6 Laufzeit und Beendigung
Die vorliegende Public License gilt bis zum Ablauf der Schutzfrist des Urheberrechts und der ähnlichen Rechte, die hiermit lizenziert werden. Gleichwohl erlöschen Ihre Rechte aus dieser Public License automatisch, wenn Sie die Bestimmungen dieser Public License nicht einhalten.
Soweit Ihr Recht, das lizenzierte Material zu nutzen, gemäß Abschnitt 6(a) erloschen ist, lebt es wieder auf:
automatisch zu dem Zeitpunkt, an welchem die Verletzung abgestellt ist, sofern dies innerhalb von 30 Tagen seit Ihrer Kenntnis der Verletzung geschieht; oder
durch ausdrückliche Wiedereinsetzung durch den Lizenzgeber.
Es sei klargestellt, dass dieser Abschnitt 6(b) die Rechte des Lizenzgebers, Ausgleich für Ihre Verletzung der vorliegenden Public License zu verlangen, nicht einschränkt.
Es sei klargestellt, dass der Lizenzgeber das lizenzierte Material auch unter anderen Bedingungen anbieten oder den Vertrieb des lizenzierten Materials jederzeit einstellen darf; gleichwohl erlischt dadurch die vorliegende Public License nicht.
Die Abschnitte 1, 5, 6, 7 und 8 gelten auch nach Erlöschen der vorliegenden Public License fort.
Abschnitt 7 Sonstige Bedingungen
Der Lizenzgeber ist nicht an durch Sie gestellte zusätzliche oder abweichende Bedingungen gebunden, wenn diese nicht ausdrücklich vereinbart wurden.
Jedwede das lizenzierte Material betreffenden und hier nicht genannten Umstände, Annahmen oder Vereinbarungen sind getrennt und unabhängig von den Bedingungen der vorliegenden Public License.
Abschnitt 8 Auslegung
Es sei klargestellt, dass die vorliegende Public License weder besagen noch dahingehend ausgelegt werden soll, dass sie solche Nutzungen des lizenzierten Materials verringert, begrenzt, einschränkt oder mit Bedingungen belegt, die ohne eine Erlaubnis aus dieser Public License zulässig sind.
Soweit wie möglich soll, falls eine Klausel der vorliegenden Public License als nicht durchsetzbar anzusehen ist, diese Klausel automatisch im geringst erforderlichen Maße angepasst werden, um sie durchsetzbar zu machen. Falls die Klausel nicht anpassbar ist, soll sie von der vorliegenden Public License abgeschieden werden, ohne dass die Durchsetzbarkeit der verbleibenden Bedingungen tangiert wird.
Auf keine Bedingung der vorliegenden Public License wird verzichtet und kein Verstoß dagegen soll als hingenommen gelten, außer der Lizenzgeber hat sich damit ausdrücklich einverstanden erklärt.
Nichts in der vorliegenden Public License soll zu einer Beschränkung oder Aufhebung von Privilegien und Immunitäten führen, die dem Lizenzgeber oder Ihnen insbesondere aufgrund rechtlicher Regelungen irgendeiner Rechtsordnung oder Rechtsposition zustehen, oder dahingehend interpretiert werden.
Creative Commons ist keine Vertragspartei seiner Public Licenses. Dennoch kann Creative Commons sich dazu entscheiden, eine seiner Public Licenses für selbst publiziertes Material zu verwenden, und ist in diesen Fällen als „Lizenzgeber” zu betrachten. Der Text der Creative Commons Public Licenses selbst wird mittels der CC0 Verzichtserklärung der Gemeinfreiheit überantwortet. Abgesehen vom begrenzten Zweck, darauf hinzuweisen, dass Material unter einer Creative Commons Public License freigegeben ist, und falls es nicht anderweitig erlaubt wird durch die Creative-Commons-Policies, die unter creativecommons.org/policies veröffentlicht sind, erlaubt Creative Commons es nicht, dass die Marke “Creative Commons” oder eine andere Marke oder ein anderes Logo von Creative Commons ohne vorherige schriftliche Zustimmung genutzt werden, insbesondere in Verbindung mit nicht autorisierten Veränderungen seiner Public Licenses oder sonstigen Regelungen, Übereinkünften oder Vereinbarungen in Bezug auf die Nutzung lizenzierten Materials. Es sei klargestellt, dass dieser Absatz nicht Teil der Public Licenses ist.
Creative Commons kann kontaktiert werden unter creativecommons.org.
-20
View File
@@ -1,20 +0,0 @@
using System;
using BlubbFish.IoT.Zway;
using BlubbFish.Utils;
namespace ZwayBot {
abstract class AModul {
protected ZwayController zw;
protected InIReader ini;
public AModul(ZwayController zway, InIReader settings) {
this.zw = zway;
this.ini = settings;
}
public delegate void ModulEvent(Object sender, ModulEventArgs e);
public abstract event ModulEvent Update;
public abstract void Dispose();
}
}
+14 -164
View File
@@ -1,185 +1,35 @@
using System; using System;
using System.Collections.Generic;
using System.Globalization;
using System.Text.RegularExpressions;
using System.Threading;
using BlubbFish.IoT.Zway; using BlubbFish.IoT.Zway;
using BlubbFish.IoT.Zway.Interfaces; using BlubbFish.IoT.Zway.Interfaces;
using BlubbFish.Utils; using BlubbFish.Utils;
using BlubbFish.Utils.IoT.Bots;
using BlubbFish.Utils.IoT.Bots.Events;
using BlubbFish.Utils.IoT.Bots.Moduls;
namespace ZwayBot.Moduls { namespace BlubbFish.IoT.Bots.ZwayBot.Moduls {
internal class CronJob : AModul, IDisposable { internal class CronJob : CronJob<ZwayController> {
private DateTime crontime;
private Thread thread;
public override event ModulEvent Update; public override event ModulEvent Update;
private Dictionary<String, String> cron_named = new Dictionary<String, String> { public CronJob(ZwayController zway, InIReader settings) : base(zway, settings) { }
{ "@yearly", "0 0 1 1 *" },
{ "@annually", "0 0 1 1 *" },
{ "@monthly", "0 0 1 * *" },
{ "@weekly", "0 0 * * 0" },
{ "@daily", "0 0 * * *" },
{ "@hourly", "0 * * * *" }
};
public CronJob(ZwayController zway, InIReader settings) : base(zway, settings) { protected override void SetValues(String value) {
this.crontime = DateTime.Now;
this.thread = new Thread(this.Runner);
this.thread.Start();
}
private void Runner() {
Thread.Sleep(DateTime.Now.AddMinutes(1).AddSeconds(DateTime.Now.Second * (-1)).AddMilliseconds(DateTime.Now.Millisecond * (-1)) - DateTime.Now);
while (true) {
if(this.crontime.Minute != DateTime.Now.Minute) {
this.crontime = DateTime.Now;
foreach (String item in this.ini.GetSections()) {
if(ParseCronString(this.ini.GetValue(item, "cron"))) {
this.SetValues(this.ini.GetValue(item, "set"));
}
}
}
Thread.Sleep(100);
}
}
private void SetValues(String value) {
foreach (String item in value.Split(';')) { foreach (String item in value.Split(';')) {
String[] items = item.Split(':'); String[] items = item.Split(':');
if(items.Length == 2) { if(items.Length == 2) {
String[] addr = items[0].Split('-');
String[] values = items[1].Split('-'); String[] values = items[1].Split('-');
if(addr.Length == 3 || addr.Length == 4) { ACommandClass c = this.library.GetCommandClass(items[0]);
Int32 deviceid = Int32.Parse(addr[0]); if (c != null && values.Length == 2) {
Int32 instanceid = Int32.Parse(addr[1]); if (c.HasProperty(values[0])) {
Int32 classid = Int32.Parse(addr[2]); c.SetProperty(values[0], values[1]);
ICommandClass c; this.Update?.Invoke(this, new CronEvent(items[0], values[0], values[1]));
if(addr.Length == 4) {
Int32 subcid = Int32.Parse(addr[3]);
c = this.zw.GetCommandClassSub(deviceid, instanceid, classid, subcid);
} else {
c = this.zw.GetCommandClass(deviceid, instanceid, classid);
}
if (c != null && values.Length == 2) {
if (Helper.HasProperty(c, values[0])) {
Helper.SetProperty(c, values[0], values[1]);
this.Update?.Invoke(this, new CronEvent(items[0], values[0], values[1]));
}
} }
} }
} }
} }
} }
private Boolean ParseCronString(String str) { public override void EventLibSetter() { }
str = str.Trim();
if(this.cron_named.ContainsKey(str)) {
str = this.cron_named[str];
}
String[] value = str.Split(' ');
if(value.Length != 5) {
return false;
}
if (!this.CheckDateStr(this.crontime.ToString("mm"), value[0], "0-59")) {
return false;
}
if (!this.CheckDateStr(this.crontime.ToString("HH"), value[1], "0-23")) {
return false;
}
if (!this.CheckDateStr(this.crontime.ToString("MM"), value[3], "1-12")) {
return false;
}
if (value[2] != "*" && value[4] != "*") {
if (!this.CheckDateStr(this.crontime.ToString("dd"), value[2], "1-31") && !this.CheckDateStr(((Int32)this.crontime.DayOfWeek).ToString(), value[4], "0-7")) {
return false;
}
} else {
if (!this.CheckDateStr(this.crontime.ToString("dd"), value[2], "1-31")) {
return false;
}
if (!this.CheckDateStr(((Int32)this.crontime.DayOfWeek).ToString(), value[4], "0-7")) {
return false;
}
}
return true;
}
private Boolean CheckDateStr(String date, String cron, String limit) { protected override void LibUpadteThread(Object state) { }
cron = cron.ToLower();
for (Int32 i = 0; i <= 6; i++) {
cron = cron.Replace(DateTime.Parse("2015-01-" + (4 + i) + "T00:00:00").ToString("ddd", CultureInfo.CreateSpecificCulture("en-US")), i.ToString());
cron = cron.Replace(DateTime.Parse("2015-01-" + (4 + i) + "T00:00:00").ToString("dddd", CultureInfo.CreateSpecificCulture("en-US")), i.ToString());
}
for (Int32 i = 1; i <= 12; i++) {
cron = cron.Replace(DateTime.Parse("2015-"+i+"-01T00:00:00").ToString("MMM", CultureInfo.CreateSpecificCulture("en-US")), i.ToString());
cron = cron.Replace(DateTime.Parse("2015-" + i + "-01T00:00:00").ToString("MMMM", CultureInfo.CreateSpecificCulture("en-US")), i.ToString());
}
if (cron.Contains("*")) {
cron = cron.Replace("*", limit);
}
if(cron.Contains("-")) {
MatchCollection m = new Regex("(\\d+)-(\\d+)").Matches(cron);
foreach (Match p in m) {
List<String> s = new List<String>();
for(Int32 i=Math.Min(Int32.Parse(p.Groups[1].Value), Int32.Parse(p.Groups[2].Value));i<= Math.Max(Int32.Parse(p.Groups[1].Value), Int32.Parse(p.Groups[2].Value)); i++) {
s.Add(i.ToString());
}
cron = cron.Replace(p.Groups[0].Value, String.Join(",", s));
}
}
Int32 match = 0;
if(cron.Contains("/")) {
Match m = new Regex("/(\\d+)").Match(cron);
cron = cron.Replace(m.Groups[0].Value, "");
match = Int32.Parse(m.Groups[1].Value);
}
Dictionary<Int32, String> ret = new Dictionary<Int32, String>();
if(!cron.Contains(",")) {
ret.Add(Int32.Parse(cron), "");
} else {
foreach (String item in cron.Split(',')) {
if(!ret.ContainsKey(Int32.Parse(item))) {
ret.Add(Int32.Parse(item), "");
}
}
}
if(match != 0) {
Dictionary<Int32, String> r = new Dictionary<Int32, String>();
foreach (KeyValuePair<Int32, String> item in ret) {
if(item.Key%match == 0) {
r.Add(item.Key, "");
}
}
ret = r;
}
return ret.ContainsKey(Int32.Parse(date));
}
#region IDisposable Support
private Boolean disposedValue = false;
protected virtual void Dispose(Boolean disposing) {
if (!this.disposedValue) {
if (disposing) {
this.thread.Abort();
while(this.thread.ThreadState != ThreadState.Aborted) { Thread.Sleep(100); }
}
this.thread = null;
this.disposedValue = true;
}
}
~CronJob() {
Dispose(false);
}
public override void Dispose() {
Dispose(true);
GC.SuppressFinalize(this);
}
#endregion
} }
} }
-139
View File
@@ -1,139 +0,0 @@
using System;
using System.Collections.Generic;
using BlubbFish.IoT.Zway;
using BlubbFish.IoT.Zway.Devices;
using BlubbFish.IoT.Zway.Devices.CommandClasses;
using BlubbFish.IoT.Zway.Devices.CommandClasses.CommandClassSubs;
using BlubbFish.IoT.Zway.Events;
using BlubbFish.Utils;
using BlubbFish.Utils.IoT.Connector;
using LitJson;
namespace ZwayBot.Moduls {
class Flex4Grid : AModul, IDisposable {
private ADataBackend mqtt;
private String household = "";
public override event ModulEvent Update;
public Flex4Grid(ZwayController zway, InIReader settings) : base(zway, settings) {
this.mqtt = ADataBackend.GetInstance(this.ini.GetSection("settings"));
this.ParseIni();
this.mqtt.MessageIncomming += this.Mqtt_MessageIncomming;
}
private void ParseIni() {
if (this.ini.GetValue("zway", "devices") != null) {
foreach (String device in this.ini.GetValue("zway", "devices").Split(',')) {
Int32 deviceid = Int32.Parse(device);
if (this.zw.Devices.ContainsKey(deviceid) && this.zw.Devices[deviceid].Instances.ContainsKey(0)) {
this.zw.Devices[deviceid].Instances[0].Update += this.DeviceUpdate;
}
}
}
if(this.ini.GetValue("f4g", "household") != null) {
this.household = this.ini.GetValue("f4g", "household");
}
}
private void DeviceUpdate(Object sender, DeviceUpdateEvent e) {
Instance instance = (Instance)sender;
if(e.Parent.GetType() == typeof(Switchbinary)) {
if (instance.CommandClasses.ContainsKey(37)) { //SwitchBinary
String topic = "/flex4grid/v1/households/" + this.household + "/device/state";
String text = JsonMapper.ToJson(new Dictionary<String, String>() {
{ "status", ((Switchbinary)instance.CommandClasses[37]).Level?"active":"idle" },
{ "timestamp", DateTime.Now.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffffff'Z'") },
{ "type", ((Switchbinary)instance.CommandClasses[37]).Name },
{ "id", instance.DeviceId.ToString() }
}).ToString();
this.mqtt.Send(topic, text);
this.Update?.Invoke(this, new Flex4gridEvent(topic, text));
}
} else if(e.Parent.GetType() == typeof(Sensormultilevelsub) || e.Parent.GetType() == typeof(Metersub)) {
if (instance.CommandClasses.ContainsKey(49) && ((Sensormultilevel)instance.CommandClasses[49]).Sub.ContainsKey(4) && //SensorMultilevel
instance.CommandClasses.ContainsKey(50) && ((Meter)instance.CommandClasses[50]).Sub.ContainsKey(0)) { //Meter
String topic = "/flex4grid/v1/households/" + this.household + "/device/consumption";
String text = JsonMapper.ToJson(new Dictionary<String, String>() {
{ "timestamp", DateTime.Now.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffffff'Z'") },
{ "id", instance.DeviceId.ToString() },
{ "power", Math.Round(((Sensormultilevelsub)((Sensormultilevel)instance.CommandClasses[49]).Sub[4]).Level).ToString("F0") },
{ "energyCumul", ((Metersub)((Meter)instance.CommandClasses[50]).Sub[0]).Level.ToString() }
}).ToString();
this.mqtt.Send(topic, text);
this.Update?.Invoke(this, new Flex4gridEvent(topic, text));
}
}
}
private void Mqtt_MessageIncomming(Object sender, MqttEventArgs e) {
JsonData message;
String topic = e.Topic;
try {
if (e.Message.StartsWith("{")) {
message = JsonMapper.ToObject(e.Message);
} else {
return;
}
} catch (Exception) {
return;
}
if(topic == "/flex4grid/v1/households/" + this.household + "/device/actuate") {
if(message.Keys.Contains("deviceId") && message.Keys.Contains("command")) {
String device = message["deviceId"].ToString();
if(this.ini.GetValue("zway", "devices") != null) {
foreach (String item in this.ini.GetValue("zway", "devices").Split(',')) {
if (item == device) {
Int32 deviceid = Int32.Parse(device);
if (this.zw.Devices.ContainsKey(deviceid) && this.zw.Devices[deviceid].Instances.ContainsKey(0) && this.zw.Devices[deviceid].Instances[0].CommandClasses.ContainsKey(37)) {
((Switchbinary)this.zw.Devices[deviceid].Instances[0].CommandClasses[37]).Level = message["command"].ToString() == "ON";
}
}
}
}
}
}
if (topic == "/flex4grid/v1/households/" + this.household + "/devices/state/request") {
if (this.ini.GetValue("zway", "devices") != null) {
Dictionary<String, String> response = new Dictionary<String, String>();
foreach (String device in this.ini.GetValue("zway", "devices").Split(',')) {
Int32 deviceid = Int32.Parse(device);
if (this.zw.Devices.ContainsKey(deviceid) && this.zw.Devices[deviceid].Instances.ContainsKey(0)) {
if (this.zw.Devices[deviceid].Instances[0].CommandClasses.ContainsKey(37)) {
Switchbinary sw = ((Switchbinary)this.zw.Devices[deviceid].Instances[0].CommandClasses[37]);
response.Add(sw.DeviceId.ToString(), sw.Level ? "active" : "idle");
}
}
}
if(response.Count != 0) {
response.Add("timestamp", DateTime.Now.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffffff'Z'"));
String rtopic = "/flex4grid/v1/households/" + this.household + "/devices/state/response";
String rtext = JsonMapper.ToJson(response).ToString();
}
}
}
}
#region IDisposable Support
private Boolean disposedValue = false;
protected virtual void Dispose(Boolean disposing) {
if (!this.disposedValue) {
if (disposing) {
this.mqtt.Dispose();
}
this.disposedValue = true;
}
}
~Flex4Grid() {
Dispose(false);
}
public override void Dispose() {
Dispose(true);
GC.SuppressFinalize(this);
}
#endregion
}
}
+109
View File
@@ -0,0 +1,109 @@
using System;
using System.Text.RegularExpressions;
using BlubbFish.IoT.Zway;
using BlubbFish.IoT.Zway.Events;
using BlubbFish.IoT.Zway.Interfaces;
using BlubbFish.Utils;
using BlubbFish.Utils.IoT.Bots;
using BlubbFish.Utils.IoT.Bots.Events;
using BlubbFish.Utils.IoT.Bots.Moduls;
using BlubbFish.Utils.IoT.Connector;
using BlubbFish.Utils.IoT.Events;
using BlubbFish.Utils.IoT.Interfaces;
using LitJson;
namespace BlubbFish.IoT.Bots.ZwayBot.Moduls {
class Mqtt : Mqtt<ZwayController> {
protected Boolean mqttConnect = false;
public override event ModulEvent Update;
public Mqtt(ZwayController zwave, InIReader settings) : base(zwave, settings) { }
#region Mqtt
protected override void Connect() {
Console.WriteLine("BlubbFish.IoT.Bots.ZwayBot.Moduls.Mqtt.Connect()");
this.mqtt = ABackend.GetInstance(this.config["settings"], ABackend.BackendType.Data);
this.mqtt.MessageIncomming += this.MqttUpdate;
this.mqttConnect = true;
}
protected override void Disconnect() {
Console.WriteLine("BlubbFish.IoT.Bots.ZwayBot.Moduls.Mqtt.Disconnect()");
this.mqttConnect = false;
if (this.mqtt != null) {
this.mqtt.MessageIncomming -= this.MqttUpdate;
}
if (this.mqtt != null) {
this.mqtt.Dispose();
}
this.mqtt = null;
}
#endregion
#region Events
public override void EventLibSetter() {
this.library.Update += this.HandleLibUpdate;
}
protected override void LibUpadteThread(Object state) {
try {
if(this.mqttConnect) {
DeviceUpdateEvent e = state as DeviceUpdateEvent;
String topic = "";
String data = "";
if (e.Parent.GetType().HasInterface(typeof(IMqtt))) {
IMqtt sensor = (IMqtt)e.Parent;
topic = "zwavebot/devices/" + sensor.MqttTopic();
data = sensor.ToJson();
}
if (topic != "" && data != "") {
((ADataBackend)this.mqtt).Send(topic, data);
this.Update?.Invoke(this, new MqttEvent(topic, data));
}
}
} catch { }
}
protected virtual void MqttUpdate(Object sender, BackendEvent e) {
try {
if (this.mqttConnect) {
if (e.From.ToString().StartsWith("zwavebot/devices/") && (e.From.ToString().EndsWith("/set") || e.From.ToString().EndsWith("/get"))) {
Match m = new Regex("^zwavebot/devices/(\\d+)/(\\d+)/(\\d+)/[gs]et$|^zwavebot/devices/(\\d+)/(\\d+)/(\\d+)/(\\d+)/[gs]et$").Match(e.From.ToString());
String id = "";
if (m.Groups[1].Success) {
id = m.Groups[1].Value + "-" + m.Groups[2].Value + "-" + m.Groups[3].Value;
}
if (m.Groups[4].Success) {
id = m.Groups[4].Value + "-" + m.Groups[5].Value + "-" + m.Groups[6].Value + "-" + m.Groups[7].Value;
}
ACommandClass c = this.library.GetCommandClass(id);
if (c == null) {
return;
}
if (e.From.ToString().EndsWith("/set")) {
try {
JsonData a = JsonMapper.ToObject(e.Message);
foreach (String item in a.Keys) {
String key = item.ToUpperLower();
if (c.HasProperty(key)) {
c.SetProperty(key, a[item].ToString());
this.Update?.Invoke(this, new MqttEvent(c.Id, a[item].ToString()));
}
}
} catch (Exception) { }
} else if (e.From.ToString().EndsWith("/get")) {
c.PollOnce = true;
((ADataBackend)this.mqtt).Send("zwavebot/devices/" + c.MqttTopic(), c.ToJson());
this.Update?.Invoke(this, new MqttEvent(e.From.ToString(), "Dataget"));
}
}
Tuple<Boolean, MqttEvent> cs = this.ChangeConfig(e, "zwavebot/config/");
if (cs.Item1) {
this.Update?.Invoke(this, cs.Item2);
}
}
} catch { }
}
#endregion
}
}
+44 -103
View File
@@ -4,119 +4,60 @@ using BlubbFish.IoT.Zway;
using BlubbFish.IoT.Zway.Events; using BlubbFish.IoT.Zway.Events;
using BlubbFish.IoT.Zway.Interfaces; using BlubbFish.IoT.Zway.Interfaces;
using BlubbFish.Utils; using BlubbFish.Utils;
using BlubbFish.Utils.IoT.Bots;
using BlubbFish.Utils.IoT.Bots.Events;
using BlubbFish.Utils.IoT.Bots.Moduls;
namespace ZwayBot.Moduls { namespace BlubbFish.IoT.Bots.ZwayBot.Moduls {
internal class Overtaker : AModul, IDisposable { internal class Overtaker : Overtaker<ZwayController> {
private Dictionary<String, Dictionary<String, String>> events = new Dictionary<String, Dictionary<String, String>>(); private readonly Dictionary<String, ACommandClass> overtakeritems = new Dictionary<String, ACommandClass>();
public override event ModulEvent Update; public override event ModulEvent Update;
public Overtaker(ZwayController zway, InIReader settings) : base(zway, settings) {
this.ParseIni(); public Overtaker(ZwayController zway, InIReader settings) : base(zway, settings) { }
protected override void AddLibraryUpdateHook(String id) {
ACommandClass c = this.library.GetCommandClass(id);
if (c != null) {
Console.WriteLine("BlubbFish.IoT.Bots.ZwayBot.Moduls.Overtaker.LibraryUpdateHook: Add Watcher to " + c.Name + " [" + c.Id + "]");
this.overtakeritems.Add(id, c);
c.Polling = true;
c.Update += this.HandleLibUpdate;
}
} }
private void ParseIni() { protected override void RemoveLibraryUpdateHooks() {
foreach (String item in this.ini.GetSections()) { foreach (KeyValuePair<String, ACommandClass> item in this.overtakeritems) {
String from = this.ini.GetValue(item, "from"); Console.WriteLine("BlubbFish.IoT.Bots.ZwayBot.Moduls.Overtaker.LibraryUpdateHook: Remove Watcher to " + item.Value.Name + " [" + item.Value.Id + "]");
String[] source = from.Split(':'); item.Value.Polling = false;
this.events.Add(source[0], this.ini.GetSection(item)); item.Value.Update -= this.HandleLibUpdate;
String[] addr = source[0].Split('-'); }
ICommandClass c; this.overtakeritems.Clear();
if (addr.Length == 3 || addr.Length == 4) { }
Int32 deviceid = Int32.Parse(addr[0]);
Int32 instanceid = Int32.Parse(addr[1]); protected override void LibUpadteThread(Object state) {
Int32 classid = Int32.Parse(addr[2]); try {
if (addr.Length == 4) { DeviceUpdateEvent e = state as DeviceUpdateEvent;
Int32 subcid = Int32.Parse(addr[3]); if (e.Parent.GetType().HasAbstract(typeof(ACommandClass))) {
c = this.zw.GetCommandClassSub(deviceid, instanceid, classid, subcid); if (this.events.ContainsKey(((ACommandClass)e.Parent).Id)) {
} else { this.SetValues(e.Parent, ((ACommandClass)e.Parent).Id, this.events[((ACommandClass)e.Parent).Id]);
c = this.zw.GetCommandClass(deviceid, instanceid, classid);
} }
if (c != null) { }
c.Polling = true; } catch { }
c.Update += this.ChangedEvent; }
protected override void SetValueHook(String id, String prop, String value) {
ACommandClass c = this.library.GetCommandClass(id);
if (c != null) {
if (c.HasProperty(prop)) {
if (c.GetProperty(prop).ToString() != value) {
c.SetProperty(prop, value);
this.Update?.Invoke(this, new OvertakerEvent(id, prop, value));
} }
} }
} }
} }
private void ChangedEvent(Object sender, DeviceUpdateEvent e) { public override void EventLibSetter() { }
if(Helper.HasInterface(sender, "ICommandClass")) {
if (this.events.ContainsKey(((ICommandClass)sender).Id)) {
this.SetValues(sender, ((ICommandClass)sender).Id, this.events[((ICommandClass)sender).Id]);
}
}
}
private void SetValues(Object sender, String name, Dictionary<String, String> dictionary) {
String from = dictionary["from"];
String[] source = from.Split(':');
if (source.Length != 2) {
return;
}
String source_value;
if (Helper.HasProperty(sender, source[1])) {
source_value = Helper.GetProperty(sender, source[1]).ToString();
} else {
return;
}
if(dictionary.ContainsKey("convert")) {
foreach (String tuple in dictionary["convert"].Split(';')) {
String[] item = tuple.Split('-');
if(source_value == item[0]) {
source_value = item[1];
}
}
}
foreach (String to in dictionary["to"].Split(';')) {
String[] target = to.Split(':');
if(target.Length == 2) {
String[] addr = target[0].Split('-');
if (addr.Length == 3 || addr.Length == 4) {
Int32 deviceid = Int32.Parse(addr[0]);
Int32 instanceid = Int32.Parse(addr[1]);
Int32 classid = Int32.Parse(addr[2]);
ICommandClass c;
if (addr.Length == 4) {
Int32 subcid = Int32.Parse(addr[3]);
c = this.zw.GetCommandClassSub(deviceid, instanceid, classid, subcid);
} else {
c = this.zw.GetCommandClass(deviceid, instanceid, classid);
}
if (c != null) {
String target_value;
if (Helper.HasProperty(c, target[1])) {
target_value = Helper.GetProperty(c, target[1]).ToString();
if (target_value != source_value) {
Helper.SetProperty(c, target[1], source_value);
this.Update?.Invoke(this, new OvertakerEvent(target[0], target[1], source_value));
}
}
}
}
}
}
}
#region IDisposable Support
private Boolean disposedValue = false;
protected virtual void Dispose(Boolean disposing) {
if (!this.disposedValue) {
if (disposing) {
}
this.disposedValue = true;
}
}
~Overtaker() {
Dispose(false);
}
public override void Dispose() {
Dispose(true);
GC.SuppressFinalize(this);
}
#endregion
} }
} }
+55
View File
@@ -0,0 +1,55 @@
using System;
using BlubbFish.IoT.Zway;
using BlubbFish.IoT.Zway.Events;
using BlubbFish.Utils;
using BlubbFish.Utils.IoT.Bots;
using BlubbFish.Utils.IoT.Bots.Events;
using BlubbFish.Utils.IoT.Connector;
using BlubbFish.Utils.IoT.Events;
using BlubbFish.Utils.IoT.Interfaces;
namespace BlubbFish.IoT.Bots.ZwayBot.Moduls {
class Senml : Mqtt {
public override event ModulEvent Update;
private readonly String SenmlGuid;
public Senml(ZwayController zway, InIReader settings) : base(zway, settings) {
if (this.config.ContainsKey("settings")) {
this.SenmlGuid = this.config["settings"]["guid"];
}
}
protected override void Connect() {
Console.WriteLine("BlubbFish.IoT.Bots.ZwayBot.Moduls.Senml.Connect()");
base.Connect();
}
protected override void Disconnect() {
Console.WriteLine("BlubbFish.IoT.Bots.ZwayBot.Moduls.Senml.Disconnect()");
base.Disconnect();
}
#region Events
protected override void LibUpadteThread(Object state) {
try {
if (this.mqttConnect) {
DeviceUpdateEvent e = state as DeviceUpdateEvent;
String topic = "";
String data = "";
if (e.Parent.GetType().HasInterface(typeof(ISenml))) {
ISenml sensor = (ISenml)e.Parent;
topic = sensor.SenmlTopic() + this.SenmlGuid + "/senml";
data = sensor.ToSenml();
}
if (topic != "" && data != null && data != "") {
((ADataBackend)this.mqtt).Send(topic, data);
this.Update?.Invoke(this, new SenmlEvent(topic, data));
}
}
} catch { }
}
protected override void MqttUpdate(Object sender, BackendEvent e) { }
#endregion
}
}
+45
View File
@@ -0,0 +1,45 @@
using System;
using System.Collections.Generic;
using BlubbFish.IoT.Zway;
using BlubbFish.IoT.Zway.Devices;
using BlubbFish.IoT.Zway.Interfaces;
using BlubbFish.Utils;
using BlubbFish.Utils.IoT.Bots.Events;
using BlubbFish.Utils.IoT.Bots.Moduls;
namespace BlubbFish.IoT.Bots.ZwayBot.Moduls {
class Statuspolling : Statuspolling<ZwayController> {
public override event ModulEvent Update;
public Statuspolling(ZwayController zway, InIReader settings) : base(zway, settings) { }
protected override void PollSpecific(Object obj) {
String devices = (String)obj;
foreach (String item in devices.Split(',')) {
ACommandClass c = this.library.GetCommandClass(item);
c.PollOnce = true;
this.Update?.Invoke(this, new StatusPollingEvent("Polling", item));
}
}
protected override void PollAll(Object obj) {
foreach (KeyValuePair<Int32, Device> device in this.library.Devices) {
foreach (KeyValuePair<Int32, Instance> instance in device.Value.Instances) {
foreach (KeyValuePair<ACommandClass.Classes, ACommandClass> commandclass in instance.Value.CommandClasses) {
commandclass.Value.PollOnce = true;
if(commandclass.Value.HasSub) {
foreach (KeyValuePair<Int32, ACommandClass> subclass in commandclass.Value.Sub) {
subclass.Value.PollOnce = true;
}
}
}
}
}
this.Update?.Invoke(this, new StatusPollingEvent("Polling", "all nodes"));
}
public override void EventLibSetter() { }
protected override void LibUpadteThread(Object state) { }
}
}
+14 -59
View File
@@ -1,82 +1,37 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO;
using System.Reflection;
using BlubbFish.IoT.Zway; using BlubbFish.IoT.Zway;
using BlubbFish.Utils; using BlubbFish.Utils;
using ZwayBot.Moduls; using BlubbFish.Utils.IoT.Bots;
namespace ZwayBot { namespace BlubbFish.IoT.Bots.ZwayBot {
class Program { class Program : Bot<ZwayController> {
static void Main(String[] args) => new Program(args); static void Main(String[] args) => new Program(args);
private ZwayController zw;
private Dictionary<String, AModul> moduls = new Dictionary<String, AModul>();
public Program(String[] args) { public Program(String[] args) {
InIReader.SetSearchPath(new List<String>() { "/etc/zwaybot", Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\zwaybot" });
Dictionary<String, String> names; Dictionary<String, String> names;
if(File.Exists("names.ini")) { if(InIReader.ConfigExist("names")) {
names = InIReader.GetInstance("names.ini").GetSection("names"); names = InIReader.GetInstance("names").GetSection("names");
} else { } else {
names = new Dictionary<String, String>(); names = new Dictionary<String, String>();
} }
if(!File.Exists("settings.ini")) { if(!InIReader.ConfigExist("settings")) {
Helper.WriteError("No settings.ini found. Abord!"); Helper.WriteError("No settings.ini found. Abord!");
return; return;
} }
this.zw = new ZwayController(InIReader.GetInstance("settings.ini").GetSection("zway"), names, false); this.logger.SetPath(InIReader.GetInstance("settings").GetValue("logging", "path"));
this.zw.Update += this.ZwayDataUpate; ZwayController zw = new ZwayController(InIReader.GetInstance("settings").GetSection("zway"), names, false);
this.ModulLoader(); zw.Update += this.ZwayDataUpate;
this.ModulLoader("BlubbFish.IoT.Bots.ZwayBot.Moduls", zw);
this.ModulInterconnect();
this.ModulEvents(); this.ModulEvents();
this.WaitForShutdown(); this.WaitForShutdown();
this.ModulDispose(); this.ModulDispose();
zw.Dispose();
} }
private void WaitForShutdown() { private void ZwayDataUpate(Object sender, Zway.Events.DeviceUpdateEvent e) {
while (true) {
System.Threading.Thread.Sleep(100);
if (Console.KeyAvailable) {
ConsoleKeyInfo key = Console.ReadKey(false);
if (key.Key == ConsoleKey.Escape) {
break;
}
}
}
}
private void ModulDispose() {
foreach (KeyValuePair<String, AModul> item in this.moduls) {
item.Value.Dispose();
Console.WriteLine("Modul entladen: " + item.Key);
}
this.zw.Dispose();
}
private void ModulEvents() {
foreach (KeyValuePair<String, AModul> item in this.moduls) {
item.Value.Update += this.ModulUpdate;
}
}
private void ModulUpdate(Object sender, ModulEventArgs e) {
Console.WriteLine(e.ToString());
}
private void ModulLoader() {
Assembly asm = Assembly.GetExecutingAssembly();
foreach (Type item in asm.GetTypes()) {
if(item.Namespace == "ZwayBot.Moduls") {
Type t = item;
String name = t.Name;
if (File.Exists(name.ToLower() + ".ini")) {
this.moduls.Add(name, (AModul)t.GetConstructor(new Type[] { typeof(ZwayController), typeof(InIReader) }).Invoke(new Object[] { this.zw, InIReader.GetInstance(name.ToLower() + ".ini") }));
Console.WriteLine("Load Modul " + name);
}
}
}
}
private void ZwayDataUpate(Object sender, BlubbFish.IoT.Zway.Events.DeviceUpdateEvent e) {
Console.WriteLine("-> ZW [" + e.UpdateTime + "]: " + e.Parent.ToString()); Console.WriteLine("-> ZW [" + e.UpdateTime + "]: " + e.Parent.ToString());
} }
} }
+8 -8
View File
@@ -1,17 +1,17 @@
using System.Reflection; using System.Reflection;
using System.Runtime.CompilerServices; using System.Resources;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
// Allgemeine Informationen über eine Assembly werden über die folgenden // Allgemeine Informationen über eine Assembly werden über die folgenden
// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern, // Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
// die einer Assembly zugeordnet sind. // die einer Assembly zugeordnet sind.
[assembly: AssemblyTitle("Zway-Bot")] [assembly: AssemblyTitle("Zway-Bot")]
[assembly: AssemblyDescription("")] [assembly: AssemblyDescription("Is a Bot for Zwave Devices")]
[assembly: AssemblyConfiguration("")] [assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")] [assembly: AssemblyCompany("BlubbFish")]
[assembly: AssemblyProduct("Zway-Bot")] [assembly: AssemblyProduct("Zway-Bot")]
[assembly: AssemblyCopyright("Copyright © 2017")] [assembly: AssemblyCopyright("Copyright © 2017 - 02.10.2018")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("BlubbFish")]
[assembly: AssemblyCulture("")] [assembly: AssemblyCulture("")]
// Durch Festlegen von ComVisible auf FALSE werden die Typen in dieser Assembly // Durch Festlegen von ComVisible auf FALSE werden die Typen in dieser Assembly
@@ -27,12 +27,12 @@ using System.Runtime.InteropServices;
// Hauptversion // Hauptversion
// Nebenversion // Nebenversion
// Buildnummer // Buildnummer
// Revision
// //
// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden, // Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden,
// übernehmen, indem Sie "*" eingeben: // übernehmen, indem Sie "*" eingeben:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyVersion("1.7.3")]
[assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.7.3")]
[assembly: NeutralResourcesLanguage("de-DE")]
// “Internet Of Things” icon by By Michael Wohlwend, US, from thenounproject.com. // “Internet Of Things” icon by By Michael Wohlwend, US, from thenounproject.com.
+2 -2
View File
@@ -8,7 +8,7 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
namespace ZwayBot.Properties { namespace BlubbFish.IoT.Bots.ZwayBot.Properties {
using System; using System;
@@ -39,7 +39,7 @@ namespace ZwayBot.Properties {
public static global::System.Resources.ResourceManager ResourceManager { public static global::System.Resources.ResourceManager ResourceManager {
get { get {
if (object.ReferenceEquals(resourceMan, null)) { if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ZwayBot.Properties.Resources", typeof(Resources).Assembly); global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("BlubbFish.IoT.Bots.ZwayBot.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp; resourceMan = temp;
} }
return resourceMan; return resourceMan;
+58 -24
View File
@@ -6,12 +6,14 @@
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{AEF8059F-8AEF-45C7-85C4-318C8F797900}</ProjectGuid> <ProjectGuid>{AEF8059F-8AEF-45C7-85C4-318C8F797900}</ProjectGuid>
<OutputType>Exe</OutputType> <OutputType>Exe</OutputType>
<RootNamespace>ZwayBot</RootNamespace> <RootNamespace>BlubbFish.IoT.Bots.ZwayBot</RootNamespace>
<AssemblyName>Zway-Bot</AssemblyName> <AssemblyName>Zway-Bot</AssemblyName>
<TargetFrameworkVersion>v4.7.1</TargetFrameworkVersion> <TargetFrameworkVersion>v4.7.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<TargetFrameworkProfile /> <TargetFrameworkProfile />
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>AnyCPU</PlatformTarget>
@@ -33,32 +35,21 @@
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
</PropertyGroup> </PropertyGroup>
<PropertyGroup> <PropertyGroup>
<StartupObject>ZwayBot.Program</StartupObject> <StartupObject>BlubbFish.IoT.Bots.ZwayBot.Program</StartupObject>
</PropertyGroup> </PropertyGroup>
<PropertyGroup> <PropertyGroup>
<ApplicationIcon>Resources\Icon.ico</ApplicationIcon> <ApplicationIcon>Resources\Icon.ico</ApplicationIcon>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="LitJson, Version=0.9.0.0, Culture=neutral, processorArchitecture=MSIL"> <None Include="dpkg\make-exe.nsi" />
<HintPath>..\packages\LitJson.0.9.0\lib\LitJson.dll</HintPath> <None Include="dpkg\make-exe.sh" />
</Reference> <None Include="dpkg\preinst" />
<Reference Include="System" /> <None Include="dpkg\postinst" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Events.cs" />
<Compile Include="Moduls\AModul.cs" />
<Compile Include="Moduls\CronJob.cs" /> <Compile Include="Moduls\CronJob.cs" />
<Compile Include="Helper.cs" /> <Compile Include="Moduls\Mqtt.cs" />
<Compile Include="Moduls\Flex4Grid.cs" />
<Compile Include="Moduls\Overtaker.cs" /> <Compile Include="Moduls\Overtaker.cs" />
<Compile Include="Moduls\Senml.cs" />
<Compile Include="Moduls\StatusPolling.cs" />
<Compile Include="Program.cs" /> <Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Properties\Resources.Designer.cs"> <Compile Include="Properties\Resources.Designer.cs">
@@ -68,9 +59,21 @@
</Compile> </Compile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\..\Utils\IoT\Connector\Data\Mosquitto\ConnectorDataMosquitto.csproj"> <ProjectReference Include="..\..\Librarys\litjson\litjson\litjson_4.7.1.csproj">
<Project>{39235fad-ba9d-4b51-82fc-6969967beae9}</Project> <Project>{91a14cd2-2940-4500-8193-56d37edddbaa}</Project>
<Name>ConnectorDataMosquitto</Name> <Name>litjson_4.7.1</Name>
</ProjectReference>
<ProjectReference Include="..\..\Utils\Bot-Utils\Bot-Utils.csproj">
<Project>{bb7bfcb5-3db0-49e1-802a-3ce3eecc59f9}</Project>
<Name>Bot-Utils</Name>
</ProjectReference>
<ProjectReference Include="..\..\Utils\IoT\Connector\Data\Mqtt\ConnectorDataMqtt.csproj">
<Project>{ee6c8f68-ed46-4c1c-abdd-cfcdf75104f2}</Project>
<Name>ConnectorDataMqtt</Name>
</ProjectReference>
<ProjectReference Include="..\..\Utils\IoT\Interfaces\Iot-Interfaces.csproj">
<Project>{4daada29-c600-4cf3-8ad3-9c97c8d7f632}</Project>
<Name>Iot-Interfaces</Name>
</ProjectReference> </ProjectReference>
<ProjectReference Include="..\..\Utils\IoT\Utils-IoT.csproj"> <ProjectReference Include="..\..\Utils\IoT\Utils-IoT.csproj">
<Project>{b870e4d5-6806-4a0b-b233-8907eedc5afc}</Project> <Project>{b870e4d5-6806-4a0b-b233-8907eedc5afc}</Project>
@@ -86,10 +89,37 @@
</ProjectReference> </ProjectReference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="packages.config" /> <None Include="config-example\cronjob.conf.example">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="config-example\names.conf.example">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="config-example\senml.conf.example">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="config-example\settings.conf.example">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="config-example\statuspolling.conf.example">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="config-example\mqtt.conf.example">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="config-example\overtaker.conf.example">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="dpkg\control" />
<None Include="dpkg\create-Builds.bat" />
<None Include="dpkg\make-deb.sh" />
<None Include="dpkg\prerm" />
<None Include="dpkg\zwaybot-logrotate" />
<None Include="dpkg\zwaybot.service" />
<None Include="Resources\Icon.ico" /> <None Include="Resources\Icon.ico" />
<Content Include="License.txt" />
<Content Include="Resources\icon.svg" /> <Content Include="Resources\icon.svg" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
@@ -98,5 +128,9 @@
<LastGenOutput>Resources.Designer.cs</LastGenOutput> <LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource> </EmbeddedResource>
</ItemGroup> </ItemGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Drawing" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project> </Project>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,10 @@
[modul]
config=public
[cold]
cron=0 23 * * 0-4
set=7-0-67-2:Level-19;7-0-112-8:Level-2
[hot]
cron=0 16 * * 1-5
set=7-0-67-1:Level-22;7-0-112-8:Level-1
@@ -0,0 +1,6 @@
[modul]
config=private
[settings]
type=mqtt
server=localhost
@@ -0,0 +1,24 @@
[names]
2-0-37=Kühlschrank Schalter
2-0-49-4=Kühlschrank Leistung
2-0-50-0=Kühlschrank Verbrauch [kWh]
2-0-50-2=Kühlschrank Verbrauch [Wh]
2-0-112-1=Kühlschrank Config (Immer AN)
2-0-112-16=Kühlschrank Config (Zurück zu altem Status nach Stromausfall)
2-0-112-34=Kühlschrank Config (Reaktion auf Alarm)
2-0-112-35=Kühlschrank Config (Antwort auf Alarmmeldung)
2-0-112-39=Kühlschrank Config (Alarm Dauer)
2-0-112-40=Kühlschrank Config (Sofortiger Bericht über Stromverbrauch)
2-0-112-42=Kühlschrank Config (Änderung der Leistung zum Generieren eines Reports)
2-0-112-43=Kühlschrank Config (Regelmäßiges Senden eines Reports über die Stromaufnahme)
2-0-112-45=Kühlschrank Config (Automatisches Senden eines Reportes über Stromverbrauch bei Verbrauchsänderung)
2-0-112-47=Kühlschrank Config (Zeitinterval zum Senden eines Reportes ohne Änderung im Verbrauch)
2-0-112-49=Kühlschrank Config (Messen des Eigenstromverbrauches)
2-0-112-50=Kühlschrank Config (unterer Leistungsschwellwert)
2-0-112-51=Kühlschrank Config (oberer Leistungsschwellwert)
2-0-112-52=Kühlschrank Config (Aktion bei Erreichen des definierten Schwellwertes (Parameter 50/51))
2-0-112-60=Kühlschrank Config (Leistungsschwellwert für violettes Blinken)
2-0-112-61=Kühlschrank Config (LED Ring Farbe im Einschaltzustand)
2-0-112-62=Kühlschrank Config (LED Ring Farbe im Ausschaltzustand)
2-0-112-63=Kühlschrank Config (LED Ring Farbe bei Z-Wave Alarmmeldungen)
2-0-112-70=Kühlschrank Config (Überlastabschaltung)
@@ -0,0 +1,12 @@
[hot]
from=7-0-67-1:Level
to=8-0-67-1:Level;9-0-67-1:Level
[cold]
from=7-0-67-2:Level
to=8-0-67-11:Level;9-0-67-11:Level
[mode]
from=7-0-112-8:Level
to=8-0-64:Level;9-0-64:Level
convert=1-1;2-11
@@ -0,0 +1,7 @@
[modul]
config=private
[settings]
type=mqtt
server=localhost
guid=linksmart-zwaybot
@@ -0,0 +1,7 @@
[zway]
server=localhost
user=admin
pass=pass
[logging]
path=/var/log/zwaybot.log
@@ -0,0 +1,3 @@
[temp]
cron=30 * * * *
devices=7-0-49-1,8-0-49-1,9-0-49-1,10-0-49-1,11-0-49-1
Binary file not shown.
@@ -0,0 +1,10 @@
[modul]
config=public
[cold]
cron=0 23 * * 0-4
set=7-0-67-2:Level-19;7-0-112-8:Level-2
[hot]
cron=0 16 * * 1-5
set=7-0-67-1:Level-22;7-0-112-8:Level-1
@@ -0,0 +1,6 @@
[modul]
config=private
[settings]
type=mqtt
server=localhost
@@ -0,0 +1,24 @@
[names]
2-0-37=Kühlschrank Schalter
2-0-49-4=Kühlschrank Leistung
2-0-50-0=Kühlschrank Verbrauch [kWh]
2-0-50-2=Kühlschrank Verbrauch [Wh]
2-0-112-1=Kühlschrank Config (Immer AN)
2-0-112-16=Kühlschrank Config (Zurück zu altem Status nach Stromausfall)
2-0-112-34=Kühlschrank Config (Reaktion auf Alarm)
2-0-112-35=Kühlschrank Config (Antwort auf Alarmmeldung)
2-0-112-39=Kühlschrank Config (Alarm Dauer)
2-0-112-40=Kühlschrank Config (Sofortiger Bericht über Stromverbrauch)
2-0-112-42=Kühlschrank Config (Änderung der Leistung zum Generieren eines Reports)
2-0-112-43=Kühlschrank Config (Regelmäßiges Senden eines Reports über die Stromaufnahme)
2-0-112-45=Kühlschrank Config (Automatisches Senden eines Reportes über Stromverbrauch bei Verbrauchsänderung)
2-0-112-47=Kühlschrank Config (Zeitinterval zum Senden eines Reportes ohne Änderung im Verbrauch)
2-0-112-49=Kühlschrank Config (Messen des Eigenstromverbrauches)
2-0-112-50=Kühlschrank Config (unterer Leistungsschwellwert)
2-0-112-51=Kühlschrank Config (oberer Leistungsschwellwert)
2-0-112-52=Kühlschrank Config (Aktion bei Erreichen des definierten Schwellwertes (Parameter 50/51))
2-0-112-60=Kühlschrank Config (Leistungsschwellwert für violettes Blinken)
2-0-112-61=Kühlschrank Config (LED Ring Farbe im Einschaltzustand)
2-0-112-62=Kühlschrank Config (LED Ring Farbe im Ausschaltzustand)
2-0-112-63=Kühlschrank Config (LED Ring Farbe bei Z-Wave Alarmmeldungen)
2-0-112-70=Kühlschrank Config (Überlastabschaltung)
@@ -0,0 +1,12 @@
[hot]
from=7-0-67-1:Level
to=8-0-67-1:Level;9-0-67-1:Level
[cold]
from=7-0-67-2:Level
to=8-0-67-11:Level;9-0-67-11:Level
[mode]
from=7-0-112-8:Level
to=8-0-64:Level;9-0-64:Level
convert=1-1;2-11
@@ -0,0 +1,7 @@
[modul]
config=private
[settings]
type=mqtt
server=localhost
guid=linksmart-zwaybot
@@ -0,0 +1,7 @@
[zway]
server=localhost
user=admin
pass=pass
[logging]
path=/var/log/zwaybot.log
@@ -0,0 +1,3 @@
[temp]
cron=30 * * * *
devices=7-0-49-1,8-0-49-1,9-0-49-1,10-0-49-1,11-0-49-1
+10
View File
@@ -0,0 +1,10 @@
Package: zwaybot
Version: x.x-x
Section: base
Priority: optional
Architecture: any
Depends: mono-runtime (>= 5.16.0)
Maintainer: BlubbFish <dev@blubbfish.net>
Description: Zway-Bot
Zway-Bot manage a Zwave.me installation
so that it has more features
+3
View File
@@ -0,0 +1,3 @@
bash.exe -c "./make-deb.sh armhf"
bash.exe -c "./make-exe.sh"
pause
+49
View File
@@ -0,0 +1,49 @@
#!/bin/bash
HOMEDIR="/home/blubb"
ROOT="$HOMEDIR/deb"
OUTPUT="../bin/Release"
EXEC="$ROOT/usr/local/bin/zwaybot"
CONFIG="$ROOT/etc/zwaybot"
SYSTEMD="$ROOT/lib/systemd/system"
LOGROTATE="$ROOT/etc/logrotate.d"
DEBIAN="$ROOT/DEBIAN"
VMAJOR=$(grep -e "^\[assembly: AssemblyVersion(\"" ../Properties/AssemblyInfo.cs | cut -d'"' -f 2 | cut -d'.' -f 1)
VMINOR=$(grep -e "^\[assembly: AssemblyVersion(\"" ../Properties/AssemblyInfo.cs | cut -d'"' -f 2 | cut -d'.' -f 2)
VBUILD=$(grep -e "^\[assembly: AssemblyVersion(\"" ../Properties/AssemblyInfo.cs | cut -d'"' -f 2 | cut -d'.' -f 3)
ARCHT=$1
mkdir -p $EXEC
mkdir -p $CONFIG
mkdir -p $DEBIAN
mkdir -p $SYSTEMD
mkdir -p $LOGROTATE
cp control $DEBIAN
cp preinst $DEBIAN
cp postinst $DEBIAN
cp prerm $DEBIAN
sed -i s/Version:\ x\.x-x/"Version: $VMAJOR.$VMINOR-$VBUILD"/ $DEBIAN/control
sed -i s/Architecture:\ any/"Architecture: $ARCHT"/ $DEBIAN/control
chmod 755 $DEBIAN -R
cp zwaybot.service $SYSTEMD
chmod 644 $SYSTEMD/zwaybot.service
cp $OUTPUT/*.exe $EXEC/
find $OUTPUT -name \*.dll ! -name Mono.Posix.dll -exec cp {} $EXEC/ \;
chmod 644 $EXEC/*
chmod 755 $EXEC
cp $OUTPUT/config-example/* $CONFIG
chmod 644 $CONFIG/*
chmod 755 $CONFIG
cp zwaybot-logrotate $LOGROTATE/zwaybot
chmod 644 $LOGROTATE/*
dpkg-deb --build $ROOT
mv $HOMEDIR/deb.deb ../../../Builds/"$ARCHT-zwaybot_$VMAJOR.$VMINOR-$VBUILD.deb"
rm $HOMEDIR/deb -r
+94
View File
@@ -0,0 +1,94 @@
;--------------------------------
;Include Modern UI
!include "MUI2.nsh"
;--------------------------------
;General
Name "Zway-Bot x.x.x"
OutFile "Zway-Bot x.x.x.exe"
InstallDir "$LOCALAPPDATA\Zway-Bot"
InstallDirRegKey HKCU "Software\Zway-Bot" ""
RequestExecutionLevel user
ShowInstDetails show
ShowUninstDetails show
SetCompressor lzma
SetDateSave off
VIAddVersionKey "ProductName" "Zway-Bot"
VIAddVersionKey "CompanyName" "BlubbFish"
VIAddVersionKey "LegalTrademarks" "BlubbFish"
VIProductVersion x.x.x
;--------------------------------
;Variables
Var StartMenuFolder
;--------------------------------
;Interface Settings
!define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKCU"
!define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\Zway-Bot"
!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu Folder"
!define MUI_ICON "..\Resources\Icon.ico"
!define MUI_UNICON "..\Resources\Icon.ico"
!define MUI_FINISHPAGE_NOAUTOCLOSE
!define MUI_UNFINISHPAGE_NOAUTOCLOSE
!define MUI_STARTMENUPAGE_DEFAULTFOLDER "Zway-Bot"
;--------------------------------
;Pages
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE "..\License.txt"
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_STARTMENU Application $StartMenuFolder
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_WELCOME
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_UNPAGE_FINISH
;--------------------------------
;Languages
!insertmacro MUI_LANGUAGE "German"
;--------------------------------
;Installer Sections
InstType /NOCUSTOM
InstType Vollständig
InstType Minimal
Section "!Programm" SecProg
SectionIn 1 2
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
CreateDirectory "$SMPROGRAMS\$StartMenuFolder"
CreateShortcut "$SMPROGRAMS\$StartMenuFolder\Uninstall.lnk" "$INSTDIR\Uninstall.exe"
CreateShortcut "$SMPROGRAMS\$StartMenuFolder\Zway-Bot.lnk" "$INSTDIR\Zway-Bot.exe"
!insertmacro MUI_STARTMENU_WRITE_END
WriteRegStr HKCU "Software\Zway-Bot" "" $INSTDIR
SetOutPath "$INSTDIR"
File /r /x Mono.Posix.dll ..\bin\Release\*.dll
File /r ..\bin\Release\*.exe
WriteUninstaller "$INSTDIR\Uninstall.exe"
SectionEnd
Section "Konfigurationsdateien" SecConf
SectionIn 1
CreateDirectory "$APPDATA\zwaybot"
SetOutPath "$APPDATA\zwaybot"
File /r ..\bin\Release\config-example\*.example
SectionEnd
Section "Uninstall"
;ADD YOUR OWN FILES HERE...
Delete "$INSTDIR\*.exe"
Delete "$INSTDIR\*.dll"
Delete "$APPDATA\zwaybot\*.example"
RMDir "$INSTDIR"
RMDir "$APPDATA\zwaybot"
!insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuFolder
Delete "$SMPROGRAMS\$StartMenuFolder\Uninstall.lnk"
RMDir "$SMPROGRAMS\$StartMenuFolder"
DeleteRegKey /ifempty HKCU "Software\Zway-Bot"
SectionEnd
;--------------------------------
;Descriptions
LangString DESC_SecProg ${LANG_GERMAN} "Das Zway-Bot Programm"
LangString DESC_SecConf ${LANG_GERMAN} "Beispiel Konfigurationsdateien"
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
!insertmacro MUI_DESCRIPTION_TEXT ${SecProg} $(DESC_SecProg)
!insertmacro MUI_DESCRIPTION_TEXT ${Secconf} $(DESC_SecConf)
!insertmacro MUI_FUNCTION_DESCRIPTION_END
;--------------------------------
+14
View File
@@ -0,0 +1,14 @@
#!/bin/bash
VMAJOR=$(grep -e "^\[assembly: AssemblyVersion(\"" ../Properties/AssemblyInfo.cs | cut -d'"' -f 2 | cut -d'.' -f 1)
VMINOR=$(grep -e "^\[assembly: AssemblyVersion(\"" ../Properties/AssemblyInfo.cs | cut -d'"' -f 2 | cut -d'.' -f 2)
VBUILD=$(grep -e "^\[assembly: AssemblyVersion(\"" ../Properties/AssemblyInfo.cs | cut -d'"' -f 2 | cut -d'.' -f 3)
cp make-exe.nsi make.nsi
sed -i s/Name\ \"Zway-Bot\ x\.x\.x\"/"Name \"Zway-Bot $VMAJOR.$VMINOR.$VBUILD\""/ make.nsi
sed -i s/OutFile\ \"Zway-Bot\ x\.x\.x\.exe\"/"OutFile \"Zway-Bot $VMAJOR.$VMINOR.$VBUILD.exe\""/ make.nsi
sed -i s/VIProductVersion\ x\.x\.x/"VIProductVersion $VMAJOR.$VMINOR.$VBUILD.0"/ make.nsi
makensis make.nsi
rm make.nsi
mv "Zway-Bot $VMAJOR.$VMINOR.$VBUILD.exe" ../../../Builds/"Zway-Bot $VMAJOR.$VMINOR.$VBUILD.exe"
+8
View File
@@ -0,0 +1,8 @@
#!/bin/bash
systemctl enable zwaybot
systemctl daemon-reload
if [[ $(systemctl is-active zwaybot || true) == "active" ]]
then
service zwaybot restart
fi
+6
View File
@@ -0,0 +1,6 @@
#!/bin/bash
useradd -M zwaybot
usermod -L zwaybot
groupadd zwaybot
usermod -G zwaybot,adm zwaybot
+3
View File
@@ -0,0 +1,3 @@
#!/bin/bash
service zwaybot stop
+10
View File
@@ -0,0 +1,10 @@
/var/log/zwaybot.log {
compress
copytruncate
daily
delaycompress
missingok
notifempty
rotate 4
size=10M
}
+21
View File
@@ -0,0 +1,21 @@
# If you modify this, please also make sure to edit init.sh
[Unit]
Description=Zway-Bot manage a Zwave.me installation so that it has more features
After=network-online.target
[Service]
User=zwaybot
Group=zwaybot
WorkingDirectory=/usr/local/bin/zwaybot
# ExecStartPre=/bin/rm /var/log/zwaybot.log && /bin/touch /var/log/zwaybot.log && /bin/chown zwaybot:zwaybot /var/log/zwaybot.log && /bin/chmod 644 /var/log/zwaybot.log
ExecStart=/usr/bin/mono /usr/local/bin/zwaybot/Zway-Bot.exe
KillMode=control-group
TimeoutStopSec=5
Restart=on-failure
StandardOutput=null
StandardError=syslog
[Install]
WantedBy=multi-user.target
Alias=zwaybot.service
-4
View File
@@ -1,4 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="LitJson" version="0.9.0" targetFramework="net461" />
</packages>