Compare commits
50 Commits
Author | SHA1 | Date | |
---|---|---|---|
157ff06ba0 | |||
1cc8df148d | |||
9e06629595 | |||
77dd5c32d3 | |||
9c7d652fbb | |||
7855d78a64 | |||
cf6c452b1e | |||
acf6e6845c | |||
968d781b70 | |||
e9c9cb531d | |||
83cb131efe | |||
26a0688dae | |||
6807cd35ad | |||
877bce4d1a | |||
55f7b609b1 | |||
6089a46d63 | |||
70bcf69b1b | |||
fc108773d9 | |||
92a6ba2b64 | |||
57daf12ed4 | |||
cabcce03b3 | |||
a9c77c6614 | |||
1c84703ac6 | |||
25e1e5165d | |||
a76234f43d | |||
a3afadd5f5 | |||
002b3cf338 | |||
a7895ef59a | |||
852a096f1d | |||
69030796f5 | |||
19d92c8cac | |||
c792ea20ad | |||
611205e78f | |||
4be8bb72f4 | |||
76cb025606 | |||
aa84aa0539 | |||
04f43b95ff | |||
a1009b5293 | |||
91a05f882e | |||
74d270b6d2 | |||
200420c9b0 | |||
acf5cea593 | |||
307f03c7c0 | |||
32b4daf3fb | |||
55e88f7b45 | |||
8baef3b2b5 | |||
80baca45e5 | |||
75eac65510 | |||
44b8daa325 | |||
2cd2c7c02e |
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
/.vs
|
||||
/Zway-Bot/obj
|
||||
/Zway-Bot/bin
|
310
CHANGELOG.md
Normal file
310
CHANGELOG.md
Normal file
@ -0,0 +1,310 @@
|
||||
# Changelog
|
||||
|
||||
## 1.8.4 - 2022-01-30 - Logging now more better
|
||||
### New Features
|
||||
* Default settings.conf have now debug=false
|
||||
* ZwayDataUpdate now uses DebugLogging flag
|
||||
### Bugfixes
|
||||
* Fixing bug in logrotate-script
|
||||
### Changes
|
||||
* ProgrammLogger SetPath removed cause its done by Bot-Utils
|
||||
* IniReader SetSearchPath removed, cause its done by Bot-Utils
|
||||
*
|
||||
* Bump Bot-Utils to ([v.1.2.6](https://git.blubbfish.net/vs_utils/Bot-Utils/src/tag/v1.2.6))
|
||||
* Bump Utils to ([v.1.6.2](https://git.blubbfish.net/vs_utils/Utils/src/tag/v1.2.6))
|
||||
|
||||
## 1.8.3 - 2022-01-20 - Shutdown working
|
||||
### New Features
|
||||
* Deconstruction makes better Output
|
||||
### Bugfixes
|
||||
### Changes
|
||||
* Bump Bot-Utils to ([v.1.2.5](https://git.blubbfish.net/vs_utils/Bot-Utils/src/tag/v1.2.5))
|
||||
* Bunp Utils to ([v1.6.1](https://git.blubbfish.net/vs_utils/Utils/src/tag/v1.6.1))
|
||||
* Bump Zway to ([v1.6.1](https://git.blubbfish.net/vs_projects/Zway/src/tag/v1.6.1))
|
||||
* Modify buildscript
|
||||
|
||||
## 1.8.2 - 2022-01-19 - Logging better
|
||||
### New Features
|
||||
* Change buildscript, so logrotate is not overwritten by setup every time
|
||||
### Bugfixes
|
||||
### Changes
|
||||
* Change default logpath
|
||||
* Modify buildscript
|
||||
|
||||
## 1.8.1 - 2022-01-18 - New Default Configs
|
||||
### New Features
|
||||
* Bump Bot-Utils to ([v1.2.4](https://git.blubbfish.net/vs_utils/Bot-Utils/src/tag/v1.2.4)) and using the possibillity to enable via config if a module is loaded
|
||||
### Bugfixes
|
||||
* Buildscript not cleansup behind
|
||||
### Changes
|
||||
* New Sample Configs
|
||||
* Codingstyles
|
||||
* Add dependency to dotnet-runtime-3.1 (>= 3.1.22) in buildscript
|
||||
|
||||
## 1.8.0 - 2022-01-16 - Running again
|
||||
### New Features
|
||||
* Change licence file (LGPL 4)
|
||||
* Running in netcore now
|
||||
* Add Changelog, Contribution
|
||||
* Update Readme
|
||||
### Bugfixes
|
||||
### Changes
|
||||
* Remove releases from source
|
||||
* Using the rewrote abstract mqtt class
|
||||
* Also senml is simpler
|
||||
* Loading of names.ini different so it now passes another datastructure
|
||||
* names.ini are now containing deviceid related items and not the same data for the same device
|
||||
* settings.ini now needs a type
|
||||
* Sample config not having example in name anymore
|
||||
* Buildsystem is now using ci-scripts
|
||||
* Windows installer using new location of icons
|
||||
|
||||
## 1.7.3 - 2018-10-29 - Change dependencys
|
||||
### New Features
|
||||
* Add readme
|
||||
### Bugfixes
|
||||
### Changes
|
||||
* update mono-runtime dependency to 5.16
|
||||
* Move licence to another location
|
||||
|
||||
## 1.7.2 - 2018-10-02 - Improve
|
||||
### New Features
|
||||
* Add Logging to some Modules
|
||||
### Bugfixes
|
||||
* fixing a bug in overtaker (now it not removes every time all events, so only the latest event are watched)
|
||||
### Changes
|
||||
|
||||
## 1.7.1 - 2018-09-29 - Tiny fix for nullpointer exception
|
||||
### New Features
|
||||
### Bugfixes
|
||||
* Fixing issue in zway lib ([v1.5.1](https://git.blubbfish.net/vs_projects/Zway/src/tag/v1.5.1))
|
||||
### Changes
|
||||
|
||||
## 1.7.0 - 2018-09-29 - Rewrite of Eventhandleing, Threaded
|
||||
### New Features
|
||||
* Rewrite of Eventhandleing, Threaded
|
||||
* enable service before reloading systemd
|
||||
* kill the process if its not stopping in 5s
|
||||
### Bugfixes
|
||||
### Changes
|
||||
* Change the Namespace
|
||||
* Codestyle
|
||||
* Exceptionhandleing
|
||||
|
||||
## 1.6.2 - 2018-06-09 - Moved CronJob, Overtaker, Statuspolling to Abstract Bot-Utils
|
||||
### New Features
|
||||
* Add first Licence
|
||||
* Move more to Bot-Utils
|
||||
* Finish creation of windowssetup
|
||||
### Bugfixes
|
||||
### Changes
|
||||
|
||||
## 1.6.1 - 2018-06-07 - Add Bot-Utils and rewrite code
|
||||
### New Features
|
||||
* Move Abstract Stuff to Bot-Utils
|
||||
* Rewrite to use the new Utils Library
|
||||
* Make Senml as a childclass of Mqtt
|
||||
### Bugfixes
|
||||
### Changes
|
||||
|
||||
## 1.6.0 - 2018-06-05 - Thread that checks if a MQTT Connection exists and if not reopen it
|
||||
### New Features
|
||||
* Automatic reconnect in MQTT
|
||||
### Bugfixes
|
||||
### Changes
|
||||
|
||||
## 1.5.7 - 2018-06-02 - new try
|
||||
### New Features
|
||||
### Bugfixes
|
||||
* forget cr
|
||||
### Changes
|
||||
|
||||
## 1.5.6 - 2018-06-02 - new try
|
||||
### New Features
|
||||
### Bugfixes
|
||||
* using /bin/bash
|
||||
### Changes
|
||||
|
||||
## 1.5.5 - 2018-06-02 - new try
|
||||
### New Features
|
||||
### Bugfixes
|
||||
* restart not working correctly
|
||||
### Changes
|
||||
|
||||
## 1.5.4 - 2018-06-02 - Fixing Bug in after installation script
|
||||
### New Features
|
||||
### Bugfixes
|
||||
* not using sudo in installscripts
|
||||
### Changes
|
||||
|
||||
## 1.5.3 - 2018-06-02 - Making service linux running
|
||||
### New Features
|
||||
* restart the service if its was running before
|
||||
* Output the error to syslog
|
||||
### Bugfixes
|
||||
### Changes
|
||||
|
||||
## 1.5.2 - 2018-06-02 - Cleanup
|
||||
### New Features
|
||||
* Debian Package includes the arch in name
|
||||
### Bugfixes
|
||||
* Try to fix a shutdown bug
|
||||
### Changes
|
||||
* Move deb package to another dictionary
|
||||
* Codingstyle
|
||||
* Programm is not stared automatically after install
|
||||
* Remove the creation of logfile in service file
|
||||
|
||||
## 1.5.1 - 2018-06-02 - Logrotate
|
||||
### New Features
|
||||
* Output when creating the waiting loop
|
||||
* Add logrotate script to debian package
|
||||
### Bugfixes
|
||||
* Absolute paths in service file
|
||||
### Changes
|
||||
|
||||
## 1.5.0 - 2018-05-29 - More Systemd
|
||||
### New Features
|
||||
* Buildscript now dedects the versionnumber itselfs
|
||||
### Bugfixes
|
||||
* Mono.Runtime is only called when its presend
|
||||
* postinst reloads systemctl first before try to start service
|
||||
* Create the logfile first before start the programm
|
||||
### Changes
|
||||
* Remove the old starting system with screen
|
||||
|
||||
## 1.4.3 - 2018-05-15 - Now sould dedect Strg+c on Linux
|
||||
### New Features
|
||||
* Posibillity to dedect Interrupt on Linux also
|
||||
* Extend debian package to use postinst, where the service is started
|
||||
* preinst now creates a group
|
||||
### Bugfixes
|
||||
* Remove BOM on sample configs
|
||||
### Changes
|
||||
|
||||
## 1.4.2 - 2018-05-15 - Fixinig installations dpkg script
|
||||
### New Features
|
||||
* The arch is now an argument in build
|
||||
### Bugfixes
|
||||
### Changes
|
||||
|
||||
## 1.4.1 - 2018-05-15 - Fixinig installations dpkg script
|
||||
### New Features
|
||||
### Bugfixes
|
||||
* Using any instead of i386 arch
|
||||
### Changes
|
||||
|
||||
## 1.4.0 - 2018-05-15 - Utils.csproj
|
||||
### New Features
|
||||
* Using Programmlogger now
|
||||
* Extend debian package to use systemd
|
||||
* Add linux systemd service file
|
||||
### Bugfixes
|
||||
* Remove Starting / in mqtt topic
|
||||
### Changes
|
||||
* Waiting fot Interrupt for exit the program
|
||||
* Codingstyles
|
||||
|
||||
## 1.3.4 - 2018-05-12 - Bump zway lib to v1.4.3
|
||||
### New Features
|
||||
* Start of generating windows installer
|
||||
### Bugfixes
|
||||
* Fixing issue in zway lib ([v1.4.3](https://git.blubbfish.net/vs_projects/Zway/src/tag/v1.4.3))
|
||||
### Changes
|
||||
|
||||
## 1.3.3 - 2018-05-10 - Bump zway lib to v1.4.2.0
|
||||
### New Features
|
||||
### Bugfixes
|
||||
* Fixing issue in zway lib ([v1.4.2.0](https://git.blubbfish.net/vs_projects/Zway/src/tag/v1.4.2.0))
|
||||
### Changes
|
||||
* Move the finish deb packets to another directory
|
||||
|
||||
## 1.3.2 - 2018-05-08 - Debian Packaging
|
||||
### New Features
|
||||
* Start creating debian packages
|
||||
### Bugfixes
|
||||
### Changes
|
||||
|
||||
## 1.3.1.0 - 2018-05-07 - Add Senml
|
||||
### New Features
|
||||
* Add HasInterface to Helper
|
||||
* Add Senml Module
|
||||
* Add helper for Debian so the programm can be run as service like
|
||||
* Type /exit to shutdown the program
|
||||
* IniReader now supports the config lookup
|
||||
* Add Config examples
|
||||
### Bugfixes
|
||||
* Avoid nullpointer exception
|
||||
### Changes
|
||||
* Remove Flex4Grid Plugin
|
||||
* Make ABackend as a Parent Class of ADataBackend
|
||||
|
||||
## 1.3.0.0 - 2017-12-22 - add possability to modify the config over mqtt
|
||||
### New Features
|
||||
* Config is now stored in an array, so it can be modyfied
|
||||
### Bugfixes
|
||||
### Changes
|
||||
* Mqtt Modul Refactored
|
||||
|
||||
## 1.2.2.0 - 2017-12-19 - Set values over mqtt
|
||||
### New Features
|
||||
* Helper has now ToUpperLower
|
||||
* Possiblity to Set and get values over mqtt
|
||||
### Bugfixes
|
||||
### Changes
|
||||
|
||||
## 1.2.1.0 - 2017-12-17 - Tiny fix for mqtt
|
||||
### New Features
|
||||
* Helper can now dedect Double
|
||||
### Bugfixes
|
||||
### Changes
|
||||
|
||||
## 1.2.0.0 - 2017-12-17 - Adding Status Polling and Mqtt (not compelete)
|
||||
### New Features
|
||||
* Add IForceLoad, so a module is loaded even if there is no config for it
|
||||
* Add Mqtt Module
|
||||
* Add StatusPolling, so All devices are regulary querdied (once a day)
|
||||
### Bugfixes
|
||||
### Changes
|
||||
* Refactoring
|
||||
|
||||
## 1.1.2.1 - 2017-12-09 - Next try to emulate F4G Events
|
||||
### New Features
|
||||
### Bugfixes
|
||||
* Flex4Grid needs more hacking to emulate a client
|
||||
### Changes
|
||||
|
||||
## 1.1.2.0 - 2017-12-08 - Interconnection
|
||||
### New Features
|
||||
* Module can now access each other during load
|
||||
* Cronjob now can execure actions from other modules
|
||||
### Bugfixes
|
||||
* F4G needs to "ping" the server
|
||||
### Changes
|
||||
|
||||
## 1.1.1.0 - 2017-12-06 - F4G Module
|
||||
### New Features
|
||||
* Add Flex4Grid Module
|
||||
* Add Icon (“Internet Of Things” icon by By Michael Wohlwend, US, from thenounproject.com.)
|
||||
### Bugfixes
|
||||
### Changes
|
||||
|
||||
## 1.1.0.0 - 2017-12-02 - AModul
|
||||
### New Features
|
||||
* Internal eventing is now using ModulEventArgs
|
||||
* Add AModul, Refactoring Modules
|
||||
* Improving Modul Loading
|
||||
### Bugfixes
|
||||
### Changes
|
||||
|
||||
## 1.0.1.0 - 2017-12-01 - Cronjob Bugfix
|
||||
### New Features
|
||||
### Bugfixes
|
||||
* Fixing Bug with Cronjob
|
||||
### Changes
|
||||
|
||||
## 1.0.0.0 - 2017-11-25 - Init
|
||||
### New Features
|
||||
* First Version
|
||||
### Bugfixes
|
||||
### Changes
|
92
CONTRIBUTING.md
Normal file
92
CONTRIBUTING.md
Normal file
@ -0,0 +1,92 @@
|
||||
# Contributing
|
||||
|
||||
When contributing to this repository, please first discuss the change you wish to make via issue,
|
||||
email, or any other method with the owners of this repository before making a change.
|
||||
|
||||
Please note we have a code of conduct, please follow it in all your interactions with the project.
|
||||
|
||||
## Pull Request Process
|
||||
|
||||
1. Ensure any install or build dependencies are removed before the end of the layer when doing a
|
||||
build.
|
||||
2. Update the README.md with details of changes to the interface, this includes new environment
|
||||
variables, exposed ports, useful file locations and container parameters.
|
||||
3. Increase the version numbers in any examples files and the README.md to the new version that this
|
||||
Pull Request would represent. The versioning scheme we use is [SemVer](http://semver.org/).
|
||||
4. You may merge the Pull Request in once you have the sign-off of two other developers, or if you
|
||||
do not have permission to do that, you may request the second reviewer to merge it for you.
|
||||
|
||||
## Code of Conduct
|
||||
|
||||
### Our Pledge
|
||||
|
||||
In the interest of fostering an open and welcoming environment, we as
|
||||
contributors and maintainers pledge to making participation in our project and
|
||||
our community a harassment-free experience for everyone, regardless of age, body
|
||||
size, disability, ethnicity, gender identity and expression, level of experience,
|
||||
nationality, personal appearance, race, religion, or sexual identity and
|
||||
orientation.
|
||||
|
||||
### Our Standards
|
||||
|
||||
Examples of behavior that contributes to creating a positive environment
|
||||
include:
|
||||
|
||||
* Using welcoming and inclusive language
|
||||
* Being respectful of differing viewpoints and experiences
|
||||
* Gracefully accepting constructive criticism
|
||||
* Focusing on what is best for the community
|
||||
* Showing empathy towards other community members
|
||||
|
||||
Examples of unacceptable behavior by participants include:
|
||||
|
||||
* The use of sexualized language or imagery and unwelcome sexual attention or
|
||||
advances
|
||||
* Trolling, insulting/derogatory comments, and personal or political attacks
|
||||
* Public or private harassment
|
||||
* Publishing others' private information, such as a physical or electronic
|
||||
address, without explicit permission
|
||||
* Other conduct which could reasonably be considered inappropriate in a
|
||||
professional setting
|
||||
|
||||
### Our Responsibilities
|
||||
|
||||
Project maintainers are responsible for clarifying the standards of acceptable
|
||||
behavior and are expected to take appropriate and fair corrective action in
|
||||
response to any instances of unacceptable behavior.
|
||||
|
||||
Project maintainers have the right and responsibility to remove, edit, or
|
||||
reject comments, commits, code, wiki edits, issues, and other contributions
|
||||
that are not aligned to this Code of Conduct, or to ban temporarily or
|
||||
permanently any contributor for other behaviors that they deem inappropriate,
|
||||
threatening, offensive, or harmful.
|
||||
|
||||
### Scope
|
||||
|
||||
This Code of Conduct applies both within project spaces and in public spaces
|
||||
when an individual is representing the project or its community. Examples of
|
||||
representing a project or community include using an official project e-mail
|
||||
address, posting via an official social media account, or acting as an appointed
|
||||
representative at an online or offline event. Representation of a project may be
|
||||
further defined and clarified by project maintainers.
|
||||
|
||||
### Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||
reported by contacting the project team at git ATTTT blubbfish.net. All
|
||||
complaints will be reviewed and investigated and will result in a response that
|
||||
is deemed necessary and appropriate to the circumstances. The project team is
|
||||
obligated to maintain confidentiality with regard to the reporter of an incident.
|
||||
Further details of specific enforcement policies may be posted separately.
|
||||
|
||||
Project maintainers who do not follow or enforce the Code of Conduct in good
|
||||
faith may face temporary or permanent repercussions as determined by other
|
||||
members of the project's leadership.
|
||||
|
||||
### Attribution
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
||||
available at [http://contributor-covenant.org/version/1/4][version]
|
||||
|
||||
[homepage]: http://contributor-covenant.org
|
||||
[version]: http://contributor-covenant.org/version/1/4/
|
165
LICENSE
Normal file
165
LICENSE
Normal file
@ -0,0 +1,165 @@
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
|
||||
This version of the GNU Lesser General Public License incorporates
|
||||
the terms and conditions of version 3 of the GNU General Public
|
||||
License, supplemented by the additional permissions listed below.
|
||||
|
||||
0. Additional Definitions.
|
||||
|
||||
As used herein, "this License" refers to version 3 of the GNU Lesser
|
||||
General Public License, and the "GNU GPL" refers to version 3 of the GNU
|
||||
General Public License.
|
||||
|
||||
"The Library" refers to a covered work governed by this License,
|
||||
other than an Application or a Combined Work as defined below.
|
||||
|
||||
An "Application" is any work that makes use of an interface provided
|
||||
by the Library, but which is not otherwise based on the Library.
|
||||
Defining a subclass of a class defined by the Library is deemed a mode
|
||||
of using an interface provided by the Library.
|
||||
|
||||
A "Combined Work" is a work produced by combining or linking an
|
||||
Application with the Library. The particular version of the Library
|
||||
with which the Combined Work was made is also called the "Linked
|
||||
Version".
|
||||
|
||||
The "Minimal Corresponding Source" for a Combined Work means the
|
||||
Corresponding Source for the Combined Work, excluding any source code
|
||||
for portions of the Combined Work that, considered in isolation, are
|
||||
based on the Application, and not on the Linked Version.
|
||||
|
||||
The "Corresponding Application Code" for a Combined Work means the
|
||||
object code and/or source code for the Application, including any data
|
||||
and utility programs needed for reproducing the Combined Work from the
|
||||
Application, but excluding the System Libraries of the Combined Work.
|
||||
|
||||
1. Exception to Section 3 of the GNU GPL.
|
||||
|
||||
You may convey a covered work under sections 3 and 4 of this License
|
||||
without being bound by section 3 of the GNU GPL.
|
||||
|
||||
2. Conveying Modified Versions.
|
||||
|
||||
If you modify a copy of the Library, and, in your modifications, a
|
||||
facility refers to a function or data to be supplied by an Application
|
||||
that uses the facility (other than as an argument passed when the
|
||||
facility is invoked), then you may convey a copy of the modified
|
||||
version:
|
||||
|
||||
a) under this License, provided that you make a good faith effort to
|
||||
ensure that, in the event an Application does not supply the
|
||||
function or data, the facility still operates, and performs
|
||||
whatever part of its purpose remains meaningful, or
|
||||
|
||||
b) under the GNU GPL, with none of the additional permissions of
|
||||
this License applicable to that copy.
|
||||
|
||||
3. Object Code Incorporating Material from Library Header Files.
|
||||
|
||||
The object code form of an Application may incorporate material from
|
||||
a header file that is part of the Library. You may convey such object
|
||||
code under terms of your choice, provided that, if the incorporated
|
||||
material is not limited to numerical parameters, data structure
|
||||
layouts and accessors, or small macros, inline functions and templates
|
||||
(ten or fewer lines in length), you do both of the following:
|
||||
|
||||
a) Give prominent notice with each copy of the object code that the
|
||||
Library is used in it and that the Library and its use are
|
||||
covered by this License.
|
||||
|
||||
b) Accompany the object code with a copy of the GNU GPL and this license
|
||||
document.
|
||||
|
||||
4. Combined Works.
|
||||
|
||||
You may convey a Combined Work under terms of your choice that,
|
||||
taken together, effectively do not restrict modification of the
|
||||
portions of the Library contained in the Combined Work and reverse
|
||||
engineering for debugging such modifications, if you also do each of
|
||||
the following:
|
||||
|
||||
a) Give prominent notice with each copy of the Combined Work that
|
||||
the Library is used in it and that the Library and its use are
|
||||
covered by this License.
|
||||
|
||||
b) Accompany the Combined Work with a copy of the GNU GPL and this license
|
||||
document.
|
||||
|
||||
c) For a Combined Work that displays copyright notices during
|
||||
execution, include the copyright notice for the Library among
|
||||
these notices, as well as a reference directing the user to the
|
||||
copies of the GNU GPL and this license document.
|
||||
|
||||
d) Do one of the following:
|
||||
|
||||
0) Convey the Minimal Corresponding Source under the terms of this
|
||||
License, and the Corresponding Application Code in a form
|
||||
suitable for, and under terms that permit, the user to
|
||||
recombine or relink the Application with a modified version of
|
||||
the Linked Version to produce a modified Combined Work, in the
|
||||
manner specified by section 6 of the GNU GPL for conveying
|
||||
Corresponding Source.
|
||||
|
||||
1) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (a) uses at run time
|
||||
a copy of the Library already present on the user's computer
|
||||
system, and (b) will operate properly with a modified version
|
||||
of the Library that is interface-compatible with the Linked
|
||||
Version.
|
||||
|
||||
e) Provide Installation Information, but only if you would otherwise
|
||||
be required to provide such information under section 6 of the
|
||||
GNU GPL, and only to the extent that such information is
|
||||
necessary to install and execute a modified version of the
|
||||
Combined Work produced by recombining or relinking the
|
||||
Application with a modified version of the Linked Version. (If
|
||||
you use option 4d0, the Installation Information must accompany
|
||||
the Minimal Corresponding Source and Corresponding Application
|
||||
Code. If you use option 4d1, you must provide the Installation
|
||||
Information in the manner specified by section 6 of the GNU GPL
|
||||
for conveying Corresponding Source.)
|
||||
|
||||
5. Combined Libraries.
|
||||
|
||||
You may place library facilities that are a work based on the
|
||||
Library side by side in a single library together with other library
|
||||
facilities that are not Applications and are not covered by this
|
||||
License, and convey such a combined library under terms of your
|
||||
choice, if you do both of the following:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work based
|
||||
on the Library, uncombined with any other library facilities,
|
||||
conveyed under the terms of this License.
|
||||
|
||||
b) Give prominent notice with the combined library that part of it
|
||||
is a work based on the Library, and explaining where to find the
|
||||
accompanying uncombined form of the same work.
|
||||
|
||||
6. Revised Versions of the GNU Lesser General Public License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions
|
||||
of the GNU Lesser General Public License from time to time. Such new
|
||||
versions will be similar in spirit to the present version, but may
|
||||
differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Library as you received it specifies that a certain numbered version
|
||||
of the GNU Lesser General Public License "or any later version"
|
||||
applies to it, you have the option of following the terms and
|
||||
conditions either of that published version or of any later version
|
||||
published by the Free Software Foundation. If the Library as you
|
||||
received it does not specify a version number of the GNU Lesser
|
||||
General Public License, you may choose any version of the GNU Lesser
|
||||
General Public License ever published by the Free Software Foundation.
|
||||
|
||||
If the Library as you received it specifies that a proxy can decide
|
||||
whether future versions of the GNU Lesser General Public License shall
|
||||
apply, that proxy's public statement of acceptance of any version is
|
||||
permanent authorization for you to choose that version for the
|
||||
Library.
|
54
README.md
Normal file
54
README.md
Normal file
@ -0,0 +1,54 @@
|
||||
# BlubbFish.IoT.Bots.ZwayBot (Zway-Bot)
|
||||
<!-- Short description of the project. -->
|
||||
|
||||
Programm that uses the zway library and crawls zwave data from a controller.
|
||||
|
||||
This program is running on every hardware that supports dotnet.
|
||||
|
||||
<!-- A teaser figure may be added here. It is best to keep the figure small (<500KB) and in the same repo -->
|
||||
|
||||
## Getting Started
|
||||
<!-- Instruction to make the project up and running. -->
|
||||
|
||||
The project documentation is available on the [Wiki](https://git.blubbfish.net/vs_projects/Zway-Bot/wiki).
|
||||
|
||||
## Usage
|
||||
<!-- Deployment/Installation instructions. If this is software library, change this section to "Usage" and give usage examples -->
|
||||
This software can not run itselfs, cause its a library.
|
||||
|
||||
## Development
|
||||
<!-- Developer instructions. -->
|
||||
* Versioning: Use [SemVer](http://semver.org/) and tag the repository with full version string. E.g. `v1.0.0`
|
||||
|
||||
### Copyright
|
||||
|
||||
This library is under GNU LESSER GENERAL PUBLIC LICENSE Version 3
|
||||
|
||||
### Prerequisite
|
||||
|
||||
If you want to work with this programm, please checkout [zway-project](https://git.blubbfish.net/vs/zway-project) with all submodules, to get all dependencies.
|
||||
|
||||
#### Internal
|
||||
* BlubbFish.Utils ([Utils](https://git.blubbfish.net/vs_utils/Utils))
|
||||
* BlubbFish.Utils.IoT ([Utils-IoT](https://git.blubbfish.net/vs_utils/Utils-IoT))
|
||||
* BlubbFish.Utils.IoT.Bots ([Bot-Utils](https://git.blubbfish.net/vs_utils/Bot-Utils))
|
||||
* BlubbFish.Utils.IoT.Interfaces ([Iot-Interfaces](https://git.blubbfish.net/vs_utils/Iot-Interfaces))
|
||||
* BlubbFish.Utils.IoT.Connector.Data ([ConnectorDataMqtt](https://git.blubbfish.net/vs_utils/ConnectorDataMqtt))
|
||||
* BlubbFish.IoT.Zway ([Zway](https://git.blubbfish.net/vs_projects/Zway))
|
||||
|
||||
#### External
|
||||
* M2Mqtt ([Used Fork](https://github.com/blubbfish/mqtt), [Original](https://github.com/eclipse/paho.mqtt.m2mqtt))
|
||||
* litjson ([Used Fork](https://github.com/blubbfish/litjson), [Original](https://github.com/LitJSON/litjson))
|
||||
|
||||
### Test
|
||||
|
||||
You need to compile he library and use it with a calling agent.
|
||||
|
||||
### Build
|
||||
|
||||
Build it with Visual Studio.
|
||||
|
||||
## Contributing
|
||||
Contributions are welcome.
|
||||
|
||||
Please fork, make your changes, and submit a pull request. For major changes, please open an issue first and discuss it with the other authors.
|
84
Zway-Bot.sln
84
Zway-Bot.sln
@ -1,19 +1,25 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 15
|
||||
VisualStudioVersion = 15.0.27004.2010
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.29806.167
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Zway-Bot", "Zway-Bot\Zway-Bot.csproj", "{AEF8059F-8AEF-45C7-85C4-318C8F797900}"
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Zway-Bot", "Zway-Bot\Zway-Bot.csproj", "{47EE9E42-FD75-4768-B87E-30CD98845742}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Zway", "..\Zway\Zway\Zway.csproj", "{166258ED-CB3D-43F5-8E8D-3A993B64D022}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Utils", "..\Utils\Utils\Utils\Utils.csproj", "{DB0BD8C3-154C-4A72-9B17-BC043435559E}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Utils", "..\Utils\Utils\Utils.csproj", "{FAC8CE64-BF13-4ECE-8097-AEB5DD060098}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Utils-IoT", "..\Utils\Utils-IoT\Utils-IoT\Utils-IoT.csproj", "{554A9B22-98B3-4713-BE21-F76B21C5343F}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Utils-IoT", "..\Utils\IoT\Utils-IoT.csproj", "{B870E4D5-6806-4A0B-B233-8907EEDC5AFC}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Iot-Interfaces", "..\Utils\Iot-Interfaces\Iot-Interfaces\Iot-Interfaces.csproj", "{A84D05FC-A267-494F-BA6F-A1FBC165EF7F}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConnectorDataMosquitto", "..\Utils\IoT\Connector\Data\Mosquitto\ConnectorDataMosquitto.csproj", "{39235FAD-BA9D-4B51-82FC-6969967BEAE9}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ConnectorDataMqtt", "..\Utils\ConnectorDataMqtt\ConnectorDataMqtt\ConnectorDataMqtt.csproj", "{AEEC3445-A3A4-498C-8729-9AB3DC692C58}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConnectorDataMqtt", "..\Utils\IoT\Connector\Data\Mqtt\ConnectorDataMqtt.csproj", "{EE6C8F68-ED46-4C1C-ABDD-CFCDF75104F2}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bot-Utils", "..\Utils\Bot-Utils\Bot-Utils\Bot-Utils.csproj", "{FCE6AD89-D55A-4B2B-9BBB-87BBC3DC7DFA}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "litjson", "..\Librarys\litjson\litjson\litjson.csproj", "{452E1239-789A-4FA0-A7B2-B546C792C80B}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "M2Mqtt", "..\Librarys\mqtt\M2Mqtt\M2Mqtt.csproj", "{2D53CFD6-A412-4427-9461-E1CAF6815A63}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Zway", "..\Zway\Zway\Zway.csproj", "{B25686A9-D5F1-4A87-B156-9B02444DFFF7}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
@ -21,35 +27,47 @@ Global
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{AEF8059F-8AEF-45C7-85C4-318C8F797900}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{AEF8059F-8AEF-45C7-85C4-318C8F797900}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{AEF8059F-8AEF-45C7-85C4-318C8F797900}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{AEF8059F-8AEF-45C7-85C4-318C8F797900}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{166258ED-CB3D-43F5-8E8D-3A993B64D022}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{166258ED-CB3D-43F5-8E8D-3A993B64D022}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{166258ED-CB3D-43F5-8E8D-3A993B64D022}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{166258ED-CB3D-43F5-8E8D-3A993B64D022}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{FAC8CE64-BF13-4ECE-8097-AEB5DD060098}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{FAC8CE64-BF13-4ECE-8097-AEB5DD060098}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{FAC8CE64-BF13-4ECE-8097-AEB5DD060098}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{FAC8CE64-BF13-4ECE-8097-AEB5DD060098}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{B870E4D5-6806-4A0B-B233-8907EEDC5AFC}.Debug|Any CPU.ActiveCfg = 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.Build.0 = Release|Any CPU
|
||||
{39235FAD-BA9D-4B51-82FC-6969967BEAE9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{39235FAD-BA9D-4B51-82FC-6969967BEAE9}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{39235FAD-BA9D-4B51-82FC-6969967BEAE9}.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}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{EE6C8F68-ED46-4C1C-ABDD-CFCDF75104F2}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{EE6C8F68-ED46-4C1C-ABDD-CFCDF75104F2}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{EE6C8F68-ED46-4C1C-ABDD-CFCDF75104F2}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{47EE9E42-FD75-4768-B87E-30CD98845742}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{47EE9E42-FD75-4768-B87E-30CD98845742}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{47EE9E42-FD75-4768-B87E-30CD98845742}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{47EE9E42-FD75-4768-B87E-30CD98845742}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{DB0BD8C3-154C-4A72-9B17-BC043435559E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{DB0BD8C3-154C-4A72-9B17-BC043435559E}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{DB0BD8C3-154C-4A72-9B17-BC043435559E}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{DB0BD8C3-154C-4A72-9B17-BC043435559E}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{554A9B22-98B3-4713-BE21-F76B21C5343F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{554A9B22-98B3-4713-BE21-F76B21C5343F}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{554A9B22-98B3-4713-BE21-F76B21C5343F}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{554A9B22-98B3-4713-BE21-F76B21C5343F}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{A84D05FC-A267-494F-BA6F-A1FBC165EF7F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{A84D05FC-A267-494F-BA6F-A1FBC165EF7F}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{A84D05FC-A267-494F-BA6F-A1FBC165EF7F}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{A84D05FC-A267-494F-BA6F-A1FBC165EF7F}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{AEEC3445-A3A4-498C-8729-9AB3DC692C58}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{AEEC3445-A3A4-498C-8729-9AB3DC692C58}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{AEEC3445-A3A4-498C-8729-9AB3DC692C58}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{AEEC3445-A3A4-498C-8729-9AB3DC692C58}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{FCE6AD89-D55A-4B2B-9BBB-87BBC3DC7DFA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{FCE6AD89-D55A-4B2B-9BBB-87BBC3DC7DFA}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{FCE6AD89-D55A-4B2B-9BBB-87BBC3DC7DFA}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{FCE6AD89-D55A-4B2B-9BBB-87BBC3DC7DFA}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{452E1239-789A-4FA0-A7B2-B546C792C80B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{452E1239-789A-4FA0-A7B2-B546C792C80B}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{452E1239-789A-4FA0-A7B2-B546C792C80B}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{452E1239-789A-4FA0-A7B2-B546C792C80B}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{2D53CFD6-A412-4427-9461-E1CAF6815A63}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{2D53CFD6-A412-4427-9461-E1CAF6815A63}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{2D53CFD6-A412-4427-9461-E1CAF6815A63}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{2D53CFD6-A412-4427-9461-E1CAF6815A63}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{B25686A9-D5F1-4A87-B156-9B02444DFFF7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{B25686A9-D5F1-4A87-B156-9B02444DFFF7}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{B25686A9-D5F1-4A87-B156-9B02444DFFF7}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{B25686A9-D5F1-4A87-B156-9B02444DFFF7}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {FC298685-EC11-4957-9D91-F044DDDD0B6E}
|
||||
SolutionGuid = {BD3495D8-45C6-495E-81C9-EA9C711C6B75}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
@ -1,81 +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 MqttEvent : ModulEventArgs {
|
||||
public MqttEvent() {
|
||||
}
|
||||
public MqttEvent(String topic, String text) {
|
||||
this.Address = topic;
|
||||
this.Value = text;
|
||||
this.Source = "MQTT";
|
||||
}
|
||||
public override String ToString() {
|
||||
return this.Source + ": on " + this.Address + " set " + this.Value;
|
||||
}
|
||||
}
|
||||
|
||||
public class StatusPollingEvent : ModulEventArgs {
|
||||
public StatusPollingEvent() {
|
||||
}
|
||||
|
||||
public StatusPollingEvent(String text, String node) {
|
||||
this.Value = text;
|
||||
this.Address = node;
|
||||
this.Source = "POLLING";
|
||||
}
|
||||
|
||||
public override String ToString() {
|
||||
return this.Source + ": " + this.Value + " on " + this.Address;
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,63 +0,0 @@
|
||||
using System;
|
||||
using System.Reflection;
|
||||
|
||||
namespace ZwayBot {
|
||||
static class Helper {
|
||||
public static void SetProperty(this 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(Double) && Double.TryParse(value, out Double vd)) {
|
||||
prop.SetValue(o, vd);
|
||||
} else if (prop.PropertyType == typeof(Int64) && Int64.TryParse(value, out Int64 v64)) {
|
||||
prop.SetValue(o, v64);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
internal static Boolean HasProperty(this 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(this Object o, String name) {
|
||||
PropertyInfo prop = o.GetType().GetProperty(name);
|
||||
if(prop.CanRead) {
|
||||
return prop.GetValue(o);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
internal static Boolean HasAbstract(this Object o, Type type) {
|
||||
if(o.GetType().BaseType == type) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
internal static Boolean HasInterface(this Type o, String type) {
|
||||
foreach (Type item in o.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();
|
||||
}
|
||||
}
|
||||
}
|
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.4 KiB |
@ -1,4 +0,0 @@
|
||||
namespace ZwayBot.Interfaces {
|
||||
interface IForceLoad {
|
||||
}
|
||||
}
|
@ -1,25 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using BlubbFish.IoT.Zway;
|
||||
using BlubbFish.Utils;
|
||||
|
||||
namespace ZwayBot {
|
||||
abstract class AModul {
|
||||
protected ZwayController zw;
|
||||
protected InIReader ini;
|
||||
|
||||
public delegate void ModulEvent(Object sender, ModulEventArgs e);
|
||||
public abstract event ModulEvent Update;
|
||||
|
||||
public AModul(ZwayController zway, InIReader settings) {
|
||||
this.zw = zway;
|
||||
this.ini = settings;
|
||||
}
|
||||
|
||||
public virtual void Interconnect(Dictionary<String, AModul> moduls) { }
|
||||
|
||||
public virtual void SetInterconnection(String param, Action<Object> hook, Object data) { }
|
||||
|
||||
public abstract void Dispose();
|
||||
}
|
||||
}
|
@ -1,64 +1,23 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading;
|
||||
|
||||
using BlubbFish.IoT.Zway;
|
||||
using BlubbFish.IoT.Zway.Interfaces;
|
||||
using BlubbFish.Utils;
|
||||
using ZwayBot.Interfaces;
|
||||
|
||||
namespace ZwayBot.Moduls {
|
||||
internal class CronJob : AModul, IDisposable, IForceLoad {
|
||||
private DateTime crontime;
|
||||
private Thread thread;
|
||||
private List<Tuple<String, Action<Object>, Object>> internalCron = new List<Tuple<String, Action<Object>, Object>>();
|
||||
using BlubbFish.Utils.IoT.Bots.Events;
|
||||
using BlubbFish.Utils.IoT.Bots.Moduls;
|
||||
|
||||
namespace BlubbFish.IoT.Bots.ZwayBot.Moduls {
|
||||
internal class CronJob : CronJob<ZwayController> {
|
||||
public override event ModulEvent Update;
|
||||
|
||||
private Dictionary<String, String> cron_named = new Dictionary<String, String> {
|
||||
{ "@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) { }
|
||||
|
||||
public CronJob(ZwayController zway, InIReader settings) : base(zway, settings) {
|
||||
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;
|
||||
if (this.ini != null) {
|
||||
foreach (String item in this.ini.GetSections()) {
|
||||
if (this.ParseCronString(this.ini.GetValue(item, "cron"))) {
|
||||
this.SetValues(this.ini.GetValue(item, "set"));
|
||||
}
|
||||
}
|
||||
}
|
||||
foreach (Tuple<String, Action<Object>, Object> item in this.internalCron) {
|
||||
if(this.ParseCronString(item.Item1)) {
|
||||
item.Item2?.Invoke(item.Item3);
|
||||
}
|
||||
}
|
||||
}
|
||||
Thread.Sleep(100);
|
||||
}
|
||||
}
|
||||
|
||||
private void SetValues(String value) {
|
||||
protected override void SetValues(String value) {
|
||||
foreach (String item in value.Split(';')) {
|
||||
String[] items = item.Split(':');
|
||||
if(items.Length == 2) {
|
||||
String[] values = items[1].Split('-');
|
||||
ACommandClass c = this.zw.GetCommandClass(items[0]);
|
||||
ACommandClass c = this.library.GetCommandClass(items[0]);
|
||||
if (c != null && values.Length == 2) {
|
||||
if (c.HasProperty(values[0])) {
|
||||
c.SetProperty(values[0], values[1]);
|
||||
@ -69,118 +28,8 @@ namespace ZwayBot.Moduls {
|
||||
}
|
||||
}
|
||||
|
||||
private Boolean ParseCronString(String str) {
|
||||
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;
|
||||
}
|
||||
public override void EventLibSetter() { }
|
||||
|
||||
private Boolean CheckDateStr(String date, String cron, String limit) {
|
||||
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));
|
||||
}
|
||||
|
||||
public override void SetInterconnection(String cron, Action<Object> hook, Object data) {
|
||||
this.internalCron.Add(new Tuple<String, Action<Object>, Object>(cron, hook, data));
|
||||
}
|
||||
|
||||
#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
|
||||
protected override void LibUpadteThread(Object state) { }
|
||||
}
|
||||
}
|
@ -1,187 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Net;
|
||||
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.IoT.Zway.Interfaces;
|
||||
using BlubbFish.Utils;
|
||||
using BlubbFish.Utils.IoT.Connector;
|
||||
using LitJson;
|
||||
|
||||
namespace ZwayBot.Moduls {
|
||||
class Flex4Grid : AModul, IDisposable {
|
||||
private ADataBackend mqtt;
|
||||
private String household = "";
|
||||
private Object requestalivelock = new Object();
|
||||
|
||||
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(ACommandClass.Classes.SwitchBinary)) {
|
||||
String topic = "/flex4grid/v1/households/" + this.household + "/device/state";
|
||||
String text = JsonMapper.ToJson(new Dictionary<String, String>() {
|
||||
{ "status", ((Switchbinary)instance.CommandClasses[ACommandClass.Classes.SwitchBinary]).Level?"active":"idle" },
|
||||
{ "timestamp", DateTime.Now.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffffff'Z'") },
|
||||
{ "type", ((Switchbinary)instance.CommandClasses[ACommandClass.Classes.SwitchBinary]).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(ACommandClass.Classes.SensorMultilevel) &&
|
||||
((Sensormultilevel)instance.CommandClasses[ACommandClass.Classes.SensorMultilevel]).Sub.ContainsKey(4) &&
|
||||
instance.CommandClasses.ContainsKey(ACommandClass.Classes.Meter) && ((Meter)instance.CommandClasses[ACommandClass.Classes.Meter]).Sub.ContainsKey(0)) {
|
||||
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[ACommandClass.Classes.SensorMultilevel]).Sub[4]).Level).ToString("F0") },
|
||||
{ "energyCumul", ((Metersub)((Meter)instance.CommandClasses[ACommandClass.Classes.Meter]).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(ACommandClass.Classes.SwitchBinary)) {
|
||||
((Switchbinary)this.zw.Devices[deviceid].Instances[0].CommandClasses[ACommandClass.Classes.SwitchBinary]).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(ACommandClass.Classes.SwitchBinary)) {
|
||||
Switchbinary sw = ((Switchbinary)this.zw.Devices[deviceid].Instances[0].CommandClasses[ACommandClass.Classes.SwitchBinary]);
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void RequestAlive(Object o) {
|
||||
String raspi = this.ini.GetValue("f4g", "raspi");
|
||||
lock (this.requestalivelock) {
|
||||
String req = "https://wiki.flex4grid.eu/rupdate/rupdate_general.yml.gpg.asc?gw=" + raspi;
|
||||
HttpWebRequest request = WebRequest.CreateHttp(req);
|
||||
try {
|
||||
using (HttpWebResponse response = (HttpWebResponse)request.GetResponse()) {
|
||||
this.Update?.Invoke(this, new Flex4gridEvent(req, response.StatusCode.ToString()));
|
||||
}
|
||||
} catch (Exception) { }
|
||||
}
|
||||
lock (this.requestalivelock) {
|
||||
String req = "https://wiki.flex4grid.eu/rupdate/rupdate_general.yml?gw=" + raspi;
|
||||
HttpWebRequest request = WebRequest.CreateHttp(req);
|
||||
try {
|
||||
using (HttpWebResponse response = (HttpWebResponse)request.GetResponse()) {
|
||||
this.Update?.Invoke(this, new Flex4gridEvent(req, response.StatusCode.ToString()));
|
||||
}
|
||||
} catch (Exception) { }
|
||||
}
|
||||
lock (this.requestalivelock) {
|
||||
String req = "http://swb.pcs.flex4grid.eu/gateway/" + raspi;
|
||||
HttpWebRequest request = WebRequest.CreateHttp(req);
|
||||
try {
|
||||
using (HttpWebResponse response = (HttpWebResponse)request.GetResponse()) {
|
||||
this.Update?.Invoke(this, new Flex4gridEvent(req, response.StatusCode.ToString()));
|
||||
}
|
||||
} catch (Exception) { }
|
||||
}
|
||||
}
|
||||
|
||||
public override void Interconnect(Dictionary<String, AModul> moduls) {
|
||||
if (this.ini.GetValue("f4g", "raspi") != null) {
|
||||
foreach (KeyValuePair<String, AModul> item in moduls) {
|
||||
if (item.Value is CronJob) {
|
||||
item.Value.SetInterconnection("10,40 * * * *", new Action<Object>(this.RequestAlive), null);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#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
|
||||
}
|
||||
}
|
@ -1,61 +1,83 @@
|
||||
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.Events;
|
||||
using BlubbFish.Utils.IoT.Bots.Moduls;
|
||||
using BlubbFish.Utils.IoT.Connector;
|
||||
using BlubbFish.Utils.IoT.Events;
|
||||
using BlubbFish.Utils.IoT.Interfaces;
|
||||
|
||||
namespace ZwayBot.Moduls {
|
||||
class Mqtt : AModul, IDisposable {
|
||||
private ADataBackend mqtt;
|
||||
using LitJson;
|
||||
|
||||
namespace BlubbFish.IoT.Bots.ZwayBot.Moduls {
|
||||
class Mqtt : Mqtt<ZwayController> {
|
||||
public override event ModulEvent Update;
|
||||
|
||||
public Mqtt(ZwayController zway, InIReader settings) : base(zway, settings) {
|
||||
this.mqtt = ADataBackend.GetInstance(this.ini.GetSection("settings"));
|
||||
this.mqtt.MessageIncomming += this.Mqtt_MessageIncomming;
|
||||
this.zw.Update += this.ZwayEvent;
|
||||
}
|
||||
public Mqtt(ZwayController lib, InIReader settings) : base(lib, settings) { }
|
||||
|
||||
private void ZwayEvent(Object sender, DeviceUpdateEvent e) {
|
||||
String topic = "";
|
||||
String data = "";
|
||||
if(e.Parent.HasAbstract(typeof(ACommandClass))) {
|
||||
ACommandClass sensor = (ACommandClass)e.Parent;
|
||||
topic = "/zwavebot/devices/" + sensor.MqttTopic();
|
||||
data = sensor.ToJson();
|
||||
|
||||
public override void EventLibSetter() => this.library.Recieved += this.HandleLibUpdate;
|
||||
|
||||
|
||||
protected override void LibUpadteThread(Object state) {
|
||||
try {
|
||||
if(this.mqtt.IsConnected) {
|
||||
DeviceUpdateEvent e = state as DeviceUpdateEvent;
|
||||
if(e.Parent.GetType().HasInterface(typeof(IMqtt))) {
|
||||
IMqtt sensor = e.Parent as IMqtt;
|
||||
((ADataBackend)this.mqtt).Send("zwavebot/devices/" + sensor.MqttTopic(), sensor.ToJson());
|
||||
this.Update?.Invoke(this, new MqttEvent("zwavebot/devices/" + sensor.MqttTopic(), sensor.ToJson()));
|
||||
}
|
||||
if(topic != "" && data != "") {
|
||||
this.mqtt.Send(topic, data);
|
||||
this.Update?.Invoke(this, new MqttEvent(topic, data));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Helper.WriteError("BlubbFish.IoT.Bots.ZwayBot.Moduls.Mqtt.LibUpadteThread: " + e.Message);
|
||||
}
|
||||
}
|
||||
|
||||
private void Mqtt_MessageIncomming(Object sender, MqttEventArgs e) {
|
||||
if(e.Message.StartsWith("/zwavebot/devices/") && e.Message.EndsWith("set")) {
|
||||
|
||||
#region Events
|
||||
protected virtual void MqttUpdate(Object sender, BackendEvent e) {
|
||||
try {
|
||||
if (this.mqtt.IsConnected) {
|
||||
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()));
|
||||
}
|
||||
}
|
||||
|
||||
#region IDisposable Support
|
||||
private Boolean disposedValue = false;
|
||||
|
||||
protected virtual void Dispose(Boolean disposing) {
|
||||
if (!this.disposedValue) {
|
||||
if (disposing) {
|
||||
this.mqtt.Dispose();
|
||||
}
|
||||
this.disposedValue = true;
|
||||
} 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"));
|
||||
}
|
||||
}
|
||||
|
||||
~Mqtt() {
|
||||
Dispose(false);
|
||||
Tuple<Boolean, MqttEvent> cs = this.ChangeConfig(e, "zwavebot/config/");
|
||||
if (cs.Item1) {
|
||||
this.Update?.Invoke(this, cs.Item2);
|
||||
}
|
||||
|
||||
public override void Dispose() {
|
||||
Dispose(true);
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
} catch { }
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
@ -1,96 +1,63 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
using BlubbFish.IoT.Zway;
|
||||
using BlubbFish.IoT.Zway.Events;
|
||||
using BlubbFish.IoT.Zway.Interfaces;
|
||||
using BlubbFish.Utils;
|
||||
using BlubbFish.Utils.IoT.Bots.Events;
|
||||
using BlubbFish.Utils.IoT.Bots.Moduls;
|
||||
|
||||
namespace ZwayBot.Moduls {
|
||||
internal class Overtaker : AModul, IDisposable {
|
||||
private Dictionary<String, Dictionary<String, String>> events = new Dictionary<String, Dictionary<String, String>>();
|
||||
|
||||
namespace BlubbFish.IoT.Bots.ZwayBot.Moduls {
|
||||
internal class Overtaker : Overtaker<ZwayController> {
|
||||
private readonly Dictionary<String, ACommandClass> overtakeritems = new Dictionary<String, ACommandClass>();
|
||||
public override event ModulEvent Update;
|
||||
|
||||
public Overtaker(ZwayController zway, InIReader settings) : base(zway, settings) {
|
||||
this.ParseIni();
|
||||
}
|
||||
|
||||
private void ParseIni() {
|
||||
foreach (String item in this.ini.GetSections()) {
|
||||
String from = this.ini.GetValue(item, "from");
|
||||
String[] source = from.Split(':');
|
||||
this.events.Add(source[0], this.ini.GetSection(item));
|
||||
ACommandClass c = this.zw.GetCommandClass(source[0]);
|
||||
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.ChangedEvent;
|
||||
}
|
||||
c.Update += this.HandleLibUpdate;
|
||||
}
|
||||
}
|
||||
|
||||
private void ChangedEvent(Object sender, DeviceUpdateEvent e) {
|
||||
if(sender.HasAbstract(typeof(ACommandClass))) {
|
||||
if (this.events.ContainsKey(((ACommandClass)sender).Id)) {
|
||||
this.SetValues(sender, ((ACommandClass)sender).Id, this.events[((ACommandClass)sender).Id]);
|
||||
}
|
||||
protected override void RemoveLibraryUpdateHooks() {
|
||||
foreach (KeyValuePair<String, ACommandClass> item in this.overtakeritems) {
|
||||
Console.WriteLine("BlubbFish.IoT.Bots.ZwayBot.Moduls.Overtaker.LibraryUpdateHook: Remove Watcher to " + item.Value.Name + " [" + item.Value.Id + "]");
|
||||
item.Value.Polling = false;
|
||||
item.Value.Update -= this.HandleLibUpdate;
|
||||
}
|
||||
this.overtakeritems.Clear();
|
||||
}
|
||||
|
||||
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 (sender.HasProperty(source[1])) {
|
||||
source_value = sender.GetProperty(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];
|
||||
protected override void LibUpadteThread(Object state) {
|
||||
try {
|
||||
DeviceUpdateEvent e = state as DeviceUpdateEvent;
|
||||
if (e.Parent.GetType().HasAbstract(typeof(ACommandClass))) {
|
||||
if (this.events.ContainsKey(((ACommandClass)e.Parent).Id)) {
|
||||
this.SetValues(e.Parent, ((ACommandClass)e.Parent).Id, this.events[((ACommandClass)e.Parent).Id]);
|
||||
}
|
||||
}
|
||||
} catch { }
|
||||
}
|
||||
foreach (String to in dictionary["to"].Split(';')) {
|
||||
String[] target = to.Split(':');
|
||||
if(target.Length == 2) {
|
||||
ACommandClass c = this.zw.GetCommandClass(target[0]);
|
||||
|
||||
protected override void SetValueHook(String id, String prop, String value) {
|
||||
ACommandClass c = this.library.GetCommandClass(id);
|
||||
if (c != null) {
|
||||
if (c.HasProperty(target[1])) {
|
||||
if (c.GetProperty(target[1]).ToString() != source_value) {
|
||||
c.SetProperty(target[1], source_value);
|
||||
this.Update?.Invoke(this, new OvertakerEvent(target[0], target[1], source_value));
|
||||
}
|
||||
}
|
||||
if (c.HasProperty(prop)) {
|
||||
if (c.GetProperty(prop).ToString() != value) {
|
||||
c.SetProperty(prop, value);
|
||||
this.Update?.Invoke(this, new OvertakerEvent(id, prop, 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
|
||||
public override void EventLibSetter() { }
|
||||
}
|
||||
}
|
41
Zway-Bot/Moduls/Senml.cs
Normal file
41
Zway-Bot/Moduls/Senml.cs
Normal file
@ -0,0 +1,41 @@
|
||||
using System;
|
||||
|
||||
using BlubbFish.IoT.Zway;
|
||||
using BlubbFish.IoT.Zway.Events;
|
||||
using BlubbFish.Utils;
|
||||
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"];
|
||||
}
|
||||
}
|
||||
|
||||
#region Events
|
||||
protected override void LibUpadteThread(Object state) {
|
||||
try {
|
||||
if(this.mqtt.IsConnected) {
|
||||
DeviceUpdateEvent e = state as DeviceUpdateEvent;
|
||||
if(e.Parent.GetType().HasInterface(typeof(ISenml))) {
|
||||
ISenml sensor = e.Parent as ISenml;
|
||||
((ADataBackend)this.mqtt).Send(sensor.SenmlTopic() + this.SenmlGuid + "/senml", sensor.ToSenml());
|
||||
this.Update?.Invoke(this, new MqttEvent(sensor.SenmlTopic() + this.SenmlGuid + "/senml", sensor.ToSenml()));
|
||||
}
|
||||
}
|
||||
} catch(Exception e) {
|
||||
Helper.WriteError("BlubbFish.IoT.Bots.ZwayBot.Moduls.Mqtt.LibUpadteThread: " + e.Message);
|
||||
}
|
||||
}
|
||||
|
||||
protected override void MqttUpdate(Object sender, BackendEvent e) { }
|
||||
#endregion
|
||||
}
|
||||
}
|
@ -1,44 +1,30 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
using BlubbFish.IoT.Zway;
|
||||
using BlubbFish.IoT.Zway.Devices;
|
||||
using BlubbFish.IoT.Zway.Interfaces;
|
||||
using BlubbFish.Utils;
|
||||
using ZwayBot.Interfaces;
|
||||
using BlubbFish.Utils.IoT.Bots.Events;
|
||||
using BlubbFish.Utils.IoT.Bots.Moduls;
|
||||
|
||||
namespace ZwayBot.Moduls {
|
||||
class Statuspolling : AModul, IDisposable, IForceLoad {
|
||||
namespace BlubbFish.IoT.Bots.ZwayBot.Moduls {
|
||||
class Statuspolling : Statuspolling<ZwayController> {
|
||||
public override event ModulEvent Update;
|
||||
|
||||
public Statuspolling(ZwayController zway, InIReader settings) : base(zway, settings) { }
|
||||
|
||||
|
||||
public override void Interconnect(Dictionary<String, AModul> moduls) {
|
||||
foreach (KeyValuePair<String, AModul> item in moduls) {
|
||||
if (item.Value is CronJob) {
|
||||
item.Value.SetInterconnection("0 0 * * *", new Action<Object>(this.PollAll), null);
|
||||
if (this.ini != null) {
|
||||
foreach (String section in this.ini.GetSections()) {
|
||||
if (this.ini.GetValue(section, "cron") != null && this.ini.GetValue(section, "devices") != null) {
|
||||
item.Value.SetInterconnection(this.ini.GetValue(section, "cron"), new Action<Object>(this.PollSpecific), this.ini.GetValue(section, "devices"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void PollSpecific(Object obj) {
|
||||
protected override void PollSpecific(Object obj) {
|
||||
String devices = (String)obj;
|
||||
foreach (String item in devices.Split(',')) {
|
||||
ACommandClass c = this.zw.GetCommandClass(item);
|
||||
ACommandClass c = this.library.GetCommandClass(item);
|
||||
c.PollOnce = true;
|
||||
this.Update?.Invoke(this, new StatusPollingEvent("Polling", item));
|
||||
}
|
||||
}
|
||||
|
||||
private void PollAll(Object o) {
|
||||
foreach (KeyValuePair<Int32, Device> device in this.zw.Devices) {
|
||||
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;
|
||||
@ -53,6 +39,8 @@ namespace ZwayBot.Moduls {
|
||||
this.Update?.Invoke(this, new StatusPollingEvent("Polling", "all nodes"));
|
||||
}
|
||||
|
||||
public override void Dispose() {}
|
||||
public override void EventLibSetter() { }
|
||||
|
||||
protected override void LibUpadteThread(Object state) { }
|
||||
}
|
||||
}
|
||||
|
@ -1,92 +1,56 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Collections.ObjectModel;
|
||||
|
||||
using BlubbFish.IoT.Zway;
|
||||
using BlubbFish.Utils;
|
||||
using BlubbFish.Utils.IoT.Bots;
|
||||
|
||||
namespace ZwayBot {
|
||||
class Program {
|
||||
namespace BlubbFish.IoT.Bots.ZwayBot {
|
||||
class Program : Bot<ZwayController> {
|
||||
static void Main(String[] args) => new Program(args);
|
||||
|
||||
private ZwayController zw;
|
||||
private Dictionary<String, AModul> moduls = new Dictionary<String, AModul>();
|
||||
public Program(String[] args) : base(args, true, "zwaybot") {
|
||||
Console.WriteLine("BlubbFish.IoT.Bots.ZwayBot.Program.Constructor()");
|
||||
|
||||
public Program(String[] args) {
|
||||
Dictionary<String, String> names;
|
||||
if(File.Exists("names.ini")) {
|
||||
names = InIReader.GetInstance("names.ini").GetSection("names");
|
||||
} else {
|
||||
names = new Dictionary<String, String>();
|
||||
Dictionary<String, ReadOnlyDictionary<String, String>> names = new Dictionary<String, ReadOnlyDictionary<String, String>>();
|
||||
if(InIReader.ConfigExist("names")) {
|
||||
foreach(String item in InIReader.GetInstance("names").GetSections(false)) {
|
||||
names.Add(item, new ReadOnlyDictionary<String, String>( InIReader.GetInstance("names").GetSection(item)));
|
||||
}
|
||||
if(!File.Exists("settings.ini")) {
|
||||
}
|
||||
if(!InIReader.ConfigExist("settings")) {
|
||||
Helper.WriteError("No settings.ini found. Abord!");
|
||||
return;
|
||||
}
|
||||
this.zw = new ZwayController(InIReader.GetInstance("settings.ini").GetSection("zway"), names, false);
|
||||
this.zw.Update += this.ZwayDataUpate;
|
||||
this.ModulLoader();
|
||||
|
||||
ZwayController zw = new ZwayController(InIReader.GetInstance("settings").GetSection("zway"), names, false);
|
||||
zw.Recieved += this.ZwayDataUpate;
|
||||
|
||||
this.ModulLoader("BlubbFish.IoT.Bots.ZwayBot.Moduls", zw);
|
||||
this.ModulInterconnect();
|
||||
this.ModulEvents();
|
||||
this.WaitForShutdown();
|
||||
this.Deconstructor(zw);
|
||||
|
||||
Console.WriteLine("Bye!");
|
||||
this.Dispose();
|
||||
}
|
||||
|
||||
private void Deconstructor(ZwayController zw) {
|
||||
Console.WriteLine("BlubbFish.IoT.Bots.ZwayBot.Program.Deconstructor(): Deconstruct ZwayBot.");
|
||||
|
||||
this.ModulDispose();
|
||||
Console.WriteLine("BlubbFish.IoT.Bots.ZwayBot.Program.Deconstructor(): ModuleDisposed.");
|
||||
|
||||
zw.Dispose();
|
||||
Console.WriteLine("BlubbFish.IoT.Bots.ZwayBot.Program.Deconstructor(): Zway lib Disposed.");
|
||||
}
|
||||
|
||||
private void ModulInterconnect() {
|
||||
foreach (KeyValuePair<String, AModul> item in this.moduls) {
|
||||
item.Value.Interconnect(this.moduls);
|
||||
}
|
||||
}
|
||||
|
||||
private void WaitForShutdown() {
|
||||
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);
|
||||
} else if(t.HasInterface("IForceLoad")) {
|
||||
this.moduls.Add(name, (AModul)t.GetConstructor(new Type[] { typeof(ZwayController), typeof(InIReader) }).Invoke(new Object[] { this.zw, null }));
|
||||
Console.WriteLine("Load Modul Forced " + name);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void ZwayDataUpate(Object sender, BlubbFish.IoT.Zway.Events.DeviceUpdateEvent e) {
|
||||
private void ZwayDataUpate(Object sender, Zway.Events.DeviceUpdateEvent e) {
|
||||
if(this.DebugLogging) {
|
||||
Console.WriteLine("-> ZW [" + e.UpdateTime + "]: " + e.Parent.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,40 +0,0 @@
|
||||
using System.Resources;
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// Allgemeine Informationen über eine Assembly werden über die folgenden
|
||||
// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
|
||||
// die einer Assembly zugeordnet sind.
|
||||
[assembly: AssemblyTitle("Zway-Bot")]
|
||||
[assembly: AssemblyDescription("Is a Bot for Zwave Devices")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("BlubbFish")]
|
||||
[assembly: AssemblyProduct("Zway-Bot")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2017")]
|
||||
[assembly: AssemblyTrademark("BlubbFish")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Durch Festlegen von ComVisible auf FALSE werden die Typen in dieser Assembly
|
||||
// für COM-Komponenten unsichtbar. Wenn Sie auf einen Typ in dieser Assembly von
|
||||
// COM aus zugreifen müssen, sollten Sie das ComVisible-Attribut für diesen Typ auf "True" festlegen.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird
|
||||
[assembly: Guid("aef8059f-8aef-45c7-85c4-318c8f797900")]
|
||||
|
||||
// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten:
|
||||
//
|
||||
// Hauptversion
|
||||
// Nebenversion
|
||||
// Buildnummer
|
||||
// Revision
|
||||
//
|
||||
// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden,
|
||||
// übernehmen, indem Sie "*" eingeben:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.2.1.0")]
|
||||
[assembly: AssemblyFileVersion("1.2.1.0")]
|
||||
[assembly: NeutralResourcesLanguage("de-DE")]
|
||||
|
||||
// “Internet Of Things” icon by By Michael Wohlwend, US, from thenounproject.com.
|
73
Zway-Bot/Properties/Resources.Designer.cs
generated
73
Zway-Bot/Properties/Resources.Designer.cs
generated
@ -1,73 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// Dieser Code wurde von einem Tool generiert.
|
||||
// Laufzeitversion:4.0.30319.42000
|
||||
//
|
||||
// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
|
||||
// der Code erneut generiert wird.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace ZwayBot.Properties {
|
||||
using System;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw.
|
||||
/// </summary>
|
||||
// Diese Klasse wurde von der StronglyTypedResourceBuilder automatisch generiert
|
||||
// -Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert.
|
||||
// Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen
|
||||
// mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
public class Resources {
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Resources() {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
public static global::System.Resources.ResourceManager ResourceManager {
|
||||
get {
|
||||
if (object.ReferenceEquals(resourceMan, null)) {
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ZwayBot.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle
|
||||
/// Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
public static global::System.Globalization.CultureInfo Culture {
|
||||
get {
|
||||
return resourceCulture;
|
||||
}
|
||||
set {
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Icon ähnlich wie (Symbol).
|
||||
/// </summary>
|
||||
public static System.Drawing.Icon Icon {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("Icon", resourceCulture);
|
||||
return ((System.Drawing.Icon)(obj));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,124 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<data name="Icon" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\Icon.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
</root>
|
@ -1,109 +1,114 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{AEF8059F-8AEF-45C7-85C4-318C8F797900}</ProjectGuid>
|
||||
<OutputType>Exe</OutputType>
|
||||
<RootNamespace>ZwayBot</RootNamespace>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<RootNamespace>BlubbFish.IoT.Bots.ZwayBot.Program</RootNamespace>
|
||||
<AssemblyName>Zway-Bot</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.7.1</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||
<TargetFrameworkProfile />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<StartupObject>ZwayBot.Program</StartupObject>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<ApplicationIcon>Resources\Icon.ico</ApplicationIcon>
|
||||
<PackageId>Program.ZwayBot.Bots.IoT.BlubbFish</PackageId>
|
||||
<Version>1.8.4</Version>
|
||||
<NeutralLanguage>de-DE</NeutralLanguage>
|
||||
<Description>Is a Bot for Zwave Devices</Description>
|
||||
<Authors>BlubbFish</Authors>
|
||||
<Company>BlubbFish</Company>
|
||||
<Copyright>Copyright © BlubbFish 2017 - 30.01.2022</Copyright>
|
||||
<PackageLicenseFile>LICENSE</PackageLicenseFile>
|
||||
<PackageProjectUrl>https://git.blubbfish.net/vs_projects/Zway-Bot</PackageProjectUrl>
|
||||
<RepositoryUrl>https://git.blubbfish.net/vs_projects/Zway-Bot.git</RepositoryUrl>
|
||||
<RepositoryType>git</RepositoryType>
|
||||
<PackageReleaseNotes>
|
||||
1.8.4 - 2022-01-30 - Logging now more better
|
||||
1.8.3 - 2022-01-20 - Shutdown working
|
||||
1.8.2 - 2022-01-19 - Logging better
|
||||
1.8.1 - 2022-01-18 - New Default Configs
|
||||
1.8.0 - 2022-01-16 - Running again
|
||||
1.7.3 - 2018-10-29 - Change dependencys
|
||||
1.7.2 - 2018-10-02 - Improve
|
||||
1.7.1 - 2018-09-29 - Tiny fix for nullpointer exception
|
||||
1.7.0 - 2018-09-29 - Rewrite of Eventhandleing, Threaded
|
||||
1.6.2 - 2018-06-09 - Moved CronJob, Overtaker, Statuspolling to Abstract Bot-Utils
|
||||
1.6.1 - 2018-06-07 - Add Bot-Utils and rewrite code
|
||||
1.6.0 - 2018-06-05 - Thread that checks if a MQTT Connection exists and if not reopen it
|
||||
1.5.7 - 2018-06-02 - new try
|
||||
1.5.6 - 2018-06-02 - new try
|
||||
1.5.5 - 2018-06-02 - new try
|
||||
1.5.4 - 2018-06-02 - Fixing Bug in after installation script
|
||||
1.5.3 - 2018-06-02 - Making service linux running
|
||||
1.5.2 - 2018-06-02 - Cleanup
|
||||
1.5.1 - 2018-06-02 - Logrotate
|
||||
1.5.0 - 2018-05-29 - More Systemd
|
||||
1.4.3 - 2018-05-15 - Now sould dedect Strg+c on Linux
|
||||
1.4.2 - 2018-05-15 - Fixinig installations dpkg script
|
||||
1.4.1 - 2018-05-15 - Fixinig installations dpkg script
|
||||
1.4.0 - 2018-05-15 - Utils.csproj
|
||||
1.3.4 - 2018-05-12 - Bump zway lib to v1.4.3
|
||||
1.3.3 - 2018-05-10 - Bump zway lib to v1.4.2.0
|
||||
1.3.2 - 2018-05-08 - Debian Packaging
|
||||
1.3.1.0 - 2018-05-07 - Add Senml
|
||||
1.3.0.0 - 2017-12-22 - add possability to modify the config over mqtt
|
||||
1.2.2.0 - 2017-12-19 - Set values over mqtt
|
||||
1.2.1.0 - 2017-12-17 - Tiny fix for mqtt
|
||||
1.2.0.0 - 2017-12-17 - Adding Status Polling and Mqtt (not compelete)
|
||||
1.1.2.1 - 2017-12-09 - Next try to emulate F4G Events
|
||||
1.1.2.0 - 2017-12-08 - Interconnection
|
||||
1.1.1.0 - 2017-12-06 - F4G Module
|
||||
1.1.0.0 - 2017-12-02 - AModul
|
||||
1.0.1.0 - 2017-12-01 - Cronjob Bugfix
|
||||
1.0.0.0 - 2017-11-25 - Init
|
||||
</PackageReleaseNotes>
|
||||
<PackageIconUrl />
|
||||
<ApplicationIcon>Icon.ico</ApplicationIcon>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Reference Include="LitJson, Version=0.9.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\LitJson.0.9.0\lib\LitJson.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<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" />
|
||||
<Content Include="../CHANGELOG.md" />
|
||||
<Content Include="../CONTRIBUTING.md" />
|
||||
<Content Include="../LICENSE" />
|
||||
<Content Include="../README.md" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Include="Events.cs" />
|
||||
<Compile Include="Interfaces\IForceLoad.cs" />
|
||||
<Compile Include="Moduls\AModul.cs" />
|
||||
<Compile Include="Moduls\CronJob.cs" />
|
||||
<Compile Include="Helper.cs" />
|
||||
<Compile Include="Moduls\Flex4Grid.cs" />
|
||||
<Compile Include="Moduls\Mqtt.cs" />
|
||||
<Compile Include="Moduls\Overtaker.cs" />
|
||||
<Compile Include="Moduls\StatusPolling.cs" />
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<None Include="..\LICENSE">
|
||||
<Pack>True</Pack>
|
||||
<PackagePath></PackagePath>
|
||||
</None>
|
||||
<None Include="Resources\Icon.ico">
|
||||
<Pack>True</Pack>
|
||||
<PackagePath></PackagePath>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\Utils\IoT\Connector\Data\Mosquitto\ConnectorDataMosquitto.csproj">
|
||||
<Project>{39235fad-ba9d-4b51-82fc-6969967beae9}</Project>
|
||||
<Name>ConnectorDataMosquitto</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\Utils-IoT.csproj">
|
||||
<Project>{b870e4d5-6806-4a0b-b233-8907eedc5afc}</Project>
|
||||
<Name>Utils-IoT</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\Utils\Utils\Utils.csproj">
|
||||
<Project>{fac8ce64-bf13-4ece-8097-aeb5dd060098}</Project>
|
||||
<Name>Utils</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\Zway\Zway\Zway.csproj">
|
||||
<Project>{166258ed-cb3d-43f5-8e8d-3a993b64d022}</Project>
|
||||
<Name>Zway</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\Utils\Bot-Utils\Bot-Utils\Bot-Utils.csproj" />
|
||||
<ProjectReference Include="..\..\Utils\ConnectorDataMqtt\ConnectorDataMqtt\ConnectorDataMqtt.csproj" />
|
||||
<ProjectReference Include="..\..\Utils\Iot-Interfaces\Iot-Interfaces\Iot-Interfaces.csproj" />
|
||||
<ProjectReference Include="..\..\Utils\Utils-IoT\Utils-IoT\Utils-IoT.csproj" />
|
||||
<ProjectReference Include="..\..\Utils\Utils\Utils\Utils.csproj" />
|
||||
<ProjectReference Include="..\..\Zway\Zway\Zway.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
<None Update="config-example\cronjob.conf">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="config-example\mqtt.conf">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="config-example\names.conf">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="config-example\overtaker.conf">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="config-example\senml.conf">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="config-example\settings.conf">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="config-example\statuspolling.conf">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Resources\Icon.ico" />
|
||||
<Content Include="Resources\icon.svg" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>PublicResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
|
||||
</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.
11
Zway-Bot/config-example/cronjob.conf
Normal file
11
Zway-Bot/config-example/cronjob.conf
Normal file
@ -0,0 +1,11 @@
|
||||
[modul]
|
||||
enabled=true
|
||||
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
|
7
Zway-Bot/config-example/mqtt.conf
Normal file
7
Zway-Bot/config-example/mqtt.conf
Normal file
@ -0,0 +1,7 @@
|
||||
[modul]
|
||||
enabled=false
|
||||
config=private
|
||||
|
||||
[settings]
|
||||
type=mqtt
|
||||
server=localhost
|
86
Zway-Bot/config-example/names.conf
Normal file
86
Zway-Bot/config-example/names.conf
Normal file
@ -0,0 +1,86 @@
|
||||
[2-3-32784]
|
||||
0=Default
|
||||
0-49-1=Temperatur
|
||||
0-67-1=Einstellung Heizen Ziel
|
||||
0-67-2=Einstellung Kühlen Ziel
|
||||
0-67-10=Einstellung Automatisch Ziel
|
||||
0-91=Taster
|
||||
0-112-1=Config (Temperaturgrenzwert für Bericht)
|
||||
0-112-2=Config (Temperaturwert setzen)
|
||||
0-112-3=Config (Minimum Temperaturwert setzen)
|
||||
0-112-4=Config (Maximum Temperaturwert setzen)
|
||||
0-112-5=Config (LED Flash Periode)
|
||||
0-112-6=Config (Kontrollfunktion setzen)
|
||||
0-112-7=Config (Temporärer Überbrückungsplan)
|
||||
0-112-8=Config (Temperaturregelung setzen)
|
||||
0-112-9=Config (LED on time)
|
||||
0-112-10=Config (Dauer des LED Blinkens)
|
||||
0-112-11=Config (LED Farbe)
|
||||
0-128=Batterie
|
||||
0-132=Wakeup
|
||||
0-135=Indikator
|
||||
|
||||
[271-1536-4096]
|
||||
0=Default
|
||||
0-37=Schalter
|
||||
0-49-4=Leistung
|
||||
0-50-0=Verbrauch [kWh]
|
||||
0-50-2=Verbrauch [W]
|
||||
0-112-1=Config (Immer AN)
|
||||
0-112-16=Config (Zurück zu altem Status nach Stromausfall)
|
||||
0-112-34=Config (Reaktion auf Alarm)
|
||||
0-112-35=Config (Antwort auf Alarmmeldung)
|
||||
0-112-39=Config (Alarm Dauer)
|
||||
0-112-40=Config (Sofortiger Bericht über Stromverbrauch)
|
||||
0-112-42=Config (Änderung der Leistung zum Generieren eines Reports)
|
||||
0-112-43=Config (Regelmäßiges Senden eines Reports über die Stromaufnahme)
|
||||
0-112-45=Config (Automatisches Senden eines Reportes über Stromverbrauch bei Verbrauchsänderung)
|
||||
0-112-47=Config (Zeitinterval zum Senden eines Reportes ohne Änderung im Verbrauch)
|
||||
0-112-49=Config (Messen des Eigenstromverbrauches)
|
||||
0-112-50=Config (unterer Leistungsschwellwert)
|
||||
0-112-51=Config (oberer Leistungsschwellwert)
|
||||
0-112-52=Config (Aktion bei Erreichen des definierten Schwellwertes (Parameter 50/51))
|
||||
0-112-60=Config (Leistungsschwellwert für violettes Blinken)
|
||||
0-112-61=Config (LED Ring Farbe im Einschaltzustand)
|
||||
0-112-62=Config (LED Ring Farbe im Ausschaltzustand)
|
||||
0-112-63=Config (LED Ring Farbe bei Z-Wave Alarmmeldungen)
|
||||
0-112-70=Config (Überlastabschaltung)
|
||||
|
||||
[271-1538-4097]
|
||||
0=Default
|
||||
0-37=Schalter
|
||||
0-49-4=Leistung
|
||||
0-50-0=Verbrauch [kWh]
|
||||
0-50-2=Verbrauch [W]
|
||||
0-112-1=Config (Immer AN)
|
||||
0-112-2=Config (Zurück zu altem Status nach Stromausfall)
|
||||
0-112-3=Config (Überlastabschaltung)
|
||||
0-112-10=Config (Sofortiger Bericht über Stromverbrauch)
|
||||
0-112-11=Config (Änderung der Leistung zum Generieren eines Reports)
|
||||
0-112-12=Config (Regelmäßiges Senden eines Reports über die Stromaufnahme)
|
||||
0-112-13=Config (Automatisches Senden eines Reportes über Stromverbrauch bei Verbrauchsänderung)
|
||||
0-112-14=Config (Zeitinterval zum Senden eines Reportes ohne Änderung im Verbrauch)
|
||||
0-112-15=Config (Messen des Eigenstromverbrauches)
|
||||
0-112-20=Config (Assoziierte Geräte mitschalten invertieren)
|
||||
0-112-21=Config (unterer Leistungsschwellwert)
|
||||
0-112-22=Config (oberer Leistungsschwellwert)
|
||||
0-112-23=Config (Aktion bei Erreichen des definierten Schwellwertes (Parameter 21/22))
|
||||
0-112-24=Config (Assoziierte Geräte mitschalten)
|
||||
0-112-30=Config (Reaktion auf Alarm)
|
||||
0-112-31=Config (Antwort auf Alarmmeldung)
|
||||
0-112-32=Config (Alarm Dauer)
|
||||
0-112-40=Config (Leistungsschwellwert für violettes Blinken)
|
||||
0-112-41=Config (LED Ring Farbe im Einschaltzustand)
|
||||
0-112-42=Config (LED Ring Farbe im Ausschaltzustand)
|
||||
0-112-43=Config (LED Ring Farbe bei Z-Wave Alarmmeldungen)
|
||||
0-112-50=Config (Assozierte Geräte im sicheren Modus ansprechen)
|
||||
0-113=Alarmmeldung Leistungsschwellwert
|
||||
|
||||
[328-2-1]
|
||||
0-38=Reglerstellung
|
||||
0-49-1=Temperatur
|
||||
0-64=Thermostat Modus
|
||||
0-67-1=Einstellung Heizen
|
||||
0-67-11=Einstellung Kühlen
|
||||
0-128=Batterie
|
||||
0-132=Wakeup
|
16
Zway-Bot/config-example/overtaker.conf
Normal file
16
Zway-Bot/config-example/overtaker.conf
Normal file
@ -0,0 +1,16 @@
|
||||
[modul]
|
||||
enabled=false
|
||||
config=public
|
||||
|
||||
; [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
|
8
Zway-Bot/config-example/senml.conf
Normal file
8
Zway-Bot/config-example/senml.conf
Normal file
@ -0,0 +1,8 @@
|
||||
[modul]
|
||||
enabled=false
|
||||
config=private
|
||||
|
||||
[settings]
|
||||
type=mqtt
|
||||
server=localhost
|
||||
guid=linksmart-zwaybot
|
9
Zway-Bot/config-example/settings.conf
Normal file
9
Zway-Bot/config-example/settings.conf
Normal file
@ -0,0 +1,9 @@
|
||||
[zway]
|
||||
server=localhost
|
||||
user=admin
|
||||
pass=pass
|
||||
type=zway
|
||||
|
||||
[logging]
|
||||
path=/var/log/zwaybot/debug.log
|
||||
debug=false
|
7
Zway-Bot/config-example/statuspolling.conf
Normal file
7
Zway-Bot/config-example/statuspolling.conf
Normal file
@ -0,0 +1,7 @@
|
||||
[modul]
|
||||
enabled=true
|
||||
config=public
|
||||
|
||||
; [temp]
|
||||
; cron=30 * * * *
|
||||
; devices=7-0-49-1,8-0-49-1,9-0-49-1,10-0-49-1,11-0-49-1
|
3
Zway-Bot/dpkg/create-Builds.bat
Normal file
3
Zway-Bot/dpkg/create-Builds.bat
Normal file
@ -0,0 +1,3 @@
|
||||
bash.exe -c "./make-deb.sh"
|
||||
bash.exe -c "./make-exe.sh"
|
||||
pause
|
44
Zway-Bot/dpkg/make-deb.sh
Normal file
44
Zway-Bot/dpkg/make-deb.sh
Normal file
@ -0,0 +1,44 @@
|
||||
#!/bin/bash
|
||||
|
||||
CSPROJFILE="Zway-Bot.csproj"
|
||||
VMAJOR=$(grep -e "<Version>" ../$CSPROJFILE | cut -d'>' -f 2 | cut -d'<' -f 1 | cut -d'.' -f 1)
|
||||
VMINOR=$(grep -e "<Version>" ../$CSPROJFILE | cut -d'>' -f 2 | cut -d'<' -f 1 | cut -d'.' -f 2)
|
||||
VBUILD=$(grep -e "<Version>" ../$CSPROJFILE | cut -d'>' -f 2 | cut -d'<' -f 1 | cut -d'.' -f 3)
|
||||
|
||||
mkdir -p ../deb
|
||||
mkdir -p ../Builds
|
||||
|
||||
export NAME=zwaybot
|
||||
export MAINAINER="BlubbFish <dev@blubbfish.net>"
|
||||
export VERSION="$VMAJOR.$VMINOR-$VBUILD"
|
||||
export DESCRIPTION="Zway-Bot manage a Zwave.me installation so that it has more features"
|
||||
export DEPENDENCIES="dotnet-runtime-3.1 (>= 3.1.22)"
|
||||
|
||||
export EXEPATH=Zway-Bot.dll
|
||||
export USERNAMEGROUP=zwaybot
|
||||
export EXEARGUMENTS=" "
|
||||
export RUNNER=/usr/share/dotnet/dotnet
|
||||
export COPYEXEC="../bin/Release/netcoreapp3.1/*.dll ../bin/Release/netcoreapp3.1/Zway-Bot.deps.json ../bin/Release/netcoreapp3.1/Zway-Bot.runtimeconfig.json"
|
||||
export LOGFILE="/var/log/zwaybot/debug.log"
|
||||
|
||||
export COPYCONFIG="../bin/Release/netcoreapp3.1/config-example/*.conf"
|
||||
export CONFIGREPLACEASK="cronjob.conf mqtt.conf names.conf overtaker.conf senml.conf settings.conf statuspolling.conf"
|
||||
|
||||
cd ../deb
|
||||
export PLATFORM=armhf
|
||||
curl -s https://git.blubbfish.net/vs_utils/CI-Scripts/raw/branch/master/deb/control-build.sh | bash
|
||||
curl -s https://git.blubbfish.net/vs_utils/CI-Scripts/raw/branch/master/deb/logrotate-build.sh | bash
|
||||
curl -s https://git.blubbfish.net/vs_utils/CI-Scripts/raw/branch/master/deb/pre-post-build.sh | bash
|
||||
curl -s https://git.blubbfish.net/vs_utils/CI-Scripts/raw/branch/master/deb/service-build.sh | bash
|
||||
curl -s https://git.blubbfish.net/vs_utils/CI-Scripts/raw/branch/master/deb/build-deb.sh | bash
|
||||
|
||||
|
||||
export PLATFORM=amd64
|
||||
curl -s https://git.blubbfish.net/vs_utils/CI-Scripts/raw/branch/master/deb/control-build.sh | bash
|
||||
curl -s https://git.blubbfish.net/vs_utils/CI-Scripts/raw/branch/master/deb/build-deb.sh | bash
|
||||
|
||||
cd ..
|
||||
rm deb -rf
|
||||
|
||||
cp Builds/* ../../Builds/
|
||||
rm Builds -rf
|
96
Zway-Bot/dpkg/make-exe.nsi
Normal file
96
Zway-Bot/dpkg/make-exe.nsi
Normal file
@ -0,0 +1,96 @@
|
||||
;--------------------------------
|
||||
;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 "..\Icon.ico"
|
||||
!define MUI_UNICON "..\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"
|
||||
!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 ..\bin\Release\netcoreapp3.1\Zway-Bot.deps.json ..\bin\Release\netcoreapp3.1\Zway-Bot.runtimeconfig.json
|
||||
File /r ..\bin\Release\netcoreapp3.1\*.dll
|
||||
File /r ..\bin\Release\netcoreapp3.1\*.exe
|
||||
WriteUninstaller "$INSTDIR\Uninstall.exe"
|
||||
SectionEnd
|
||||
Section "Konfigurationsdateien" SecConf
|
||||
SectionIn 1
|
||||
CreateDirectory "$APPDATA\zwaybot"
|
||||
SetOutPath "$APPDATA\zwaybot"
|
||||
File /r ..\bin\Release\netcoreapp3.1\config-example\*.conf
|
||||
SectionEnd
|
||||
Section "Uninstall"
|
||||
;ADD YOUR OWN FILES HERE...
|
||||
Delete "$INSTDIR\*.exe"
|
||||
Delete "$INSTDIR\*.dll"
|
||||
Delete "$INSTDIR\*.json"
|
||||
Delete "$APPDATA\zwaybot\*.conf"
|
||||
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
|
||||
;--------------------------------
|
15
Zway-Bot/dpkg/make-exe.sh
Normal file
15
Zway-Bot/dpkg/make-exe.sh
Normal file
@ -0,0 +1,15 @@
|
||||
#!/bin/bash
|
||||
|
||||
CSPROJFILE="Zway-Bot.csproj"
|
||||
VMAJOR=$(grep -e "<Version>" ../$CSPROJFILE | cut -d'>' -f 2 | cut -d'<' -f 1 | cut -d'.' -f 1)
|
||||
VMINOR=$(grep -e "<Version>" ../$CSPROJFILE | cut -d'>' -f 2 | cut -d'<' -f 1 | cut -d'.' -f 2)
|
||||
VBUILD=$(grep -e "<Version>" ../$CSPROJFILE | cut -d'>' -f 2 | cut -d'<' -f 1 | 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"
|
@ -1,4 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="LitJson" version="0.9.0" targetFramework="net461" />
|
||||
</packages>
|
Loading…
Reference in New Issue
Block a user