Compare commits

...

30 Commits

Author SHA1 Message Date
157ff06ba0 [1.8.4] Logging now more better 2022-01-30 22:49:34 +01:00
1cc8df148d [1.8.3] Shutdown working 2022-01-20 20:24:30 +01:00
9e06629595 [1.8.2] Logging better 2022-01-19 22:59:10 +01:00
77dd5c32d3 [1.8.1] New Default Configs 2022-01-18 22:13:30 +01:00
9c7d652fbb Forgot to not cleanup in debian script 2022-01-16 22:44:08 +01:00
7855d78a64 [1.8.0] Running again 2022-01-16 22:36:43 +01:00
cf6c452b1e start to convert and update zwave-bot 2021-01-09 01:11:39 +01:00
acf6e6845c Remove Releases 2019-02-12 18:10:27 +01:00
968d781b70 some Changes 2019-02-11 16:45:41 +00:00
e9c9cb531d [NF] Change dependencys 2018-10-29 21:59:06 +00:00
83cb131efe Zway-Bot [v1.7.2] Add Logging to some Modules, fixing a bug in overtaker (now it not removes every time all events, so only the latest event are watched)
[Utils] Fixing a bug if more than one argument with params
2018-10-02 14:53:59 +00:00
26a0688dae Zway-Bot [v1.7.1] Tiny fix for nullpointer exception 2018-09-29 18:13:17 +00:00
6807cd35ad Zway [v1.5.0] Throw Exception if 3 times failed to connect to Raspberry server, add 3 new commandlcasses to IgnoredClasses
Zway-Bot [v1.7.0] rewrite to Threaded Modules, edit service file for systemd
2018-09-29 12:15:37 +00:00
877bce4d1a Rewrite of Eventhandleing, Threaded 2018-09-11 12:04:43 +00:00
55f7b609b1 To new Structure 2018-08-02 21:49:22 +00:00
6089a46d63 [NF] Moved CronJob, Overtaker, Statuspolling to Abstract Bot-Utils
[NF] Create NSI Script to produce exe
[NF] Add License.txt
2018-06-09 21:27:15 +00:00
70bcf69b1b [NF] Add Bot-Utils and rewrite code 2018-06-07 20:49:54 +00:00
fc108773d9 [NF] Thread that checks if a MQTT Connection exists and if not reopen it
[NF] ConnectorDataMqtt now supports user and password
2018-06-05 16:46:56 +00:00
92a6ba2b64 [BF] new try 2018-06-02 19:38:56 +00:00
57daf12ed4 [BF] new try 2018-06-02 19:36:32 +00:00
cabcce03b3 [BF] new try 2018-06-02 19:32:20 +00:00
a9c77c6614 [BF] Fixing Bug in after installation script 2018-06-02 19:08:05 +00:00
1c84703ac6 [BF] Making service linux running 2018-06-02 18:41:21 +00:00
25e1e5165d 2018-06-02 17:14:42 +00:00
a76234f43d 2018-06-01 18:23:30 +00:00
a3afadd5f5 [NF] Move 2018-05-31 18:03:57 +00:00
002b3cf338 [NF] Logrotate 2018-05-29 20:07:50 +00:00
a7895ef59a 2018-05-29 16:15:17 +00:00
852a096f1d [NF] Now sould dedect Strg+c on Linux 2018-05-15 20:52:54 +00:00
69030796f5 [BF] Fixinig installations dpkg script 2018-05-15 19:04:19 +00:00
80 changed files with 1227 additions and 1776 deletions

3
.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
/.vs
/Zway-Bot/obj
/Zway-Bot/bin

310
CHANGELOG.md Normal file
View 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
View 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
View 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
View 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.

View File

@ -1,23 +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}") = "ConnectorDataMqtt", "..\Utils\IoT\Connector\Data\Mqtt\ConnectorDataMqtt.csproj", "{EE6C8F68-ED46-4C1C-ABDD-CFCDF75104F2}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ConnectorDataMqtt", "..\Utils\ConnectorDataMqtt\ConnectorDataMqtt\ConnectorDataMqtt.csproj", "{AEEC3445-A3A4-498C-8729-9AB3DC692C58}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Iot-Interfaces", "..\Utils\IoT\Interfaces\Iot-Interfaces.csproj", "{4DAADA29-C600-4CF3-8AD3-9C97C8D7F632}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bot-Utils", "..\Utils\Bot-Utils\Bot-Utils\Bot-Utils.csproj", "{FCE6AD89-D55A-4B2B-9BBB-87BBC3DC7DFA}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "litjson_4.7.1", "..\Librarys\litjson\litjson\litjson_4.7.1.csproj", "{91A14CD2-2940-4500-8193-56D37EDDDBAA}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "litjson", "..\Librarys\litjson\litjson\litjson.csproj", "{452E1239-789A-4FA0-A7B2-B546C792C80B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "M2Mqtt", "..\Librarys\mqtt\M2Mqtt\M2Mqtt_4.7.1.csproj", "{A11AEF5A-B246-4FE8-8330-06DB73CC8074}"
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
@ -25,43 +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
{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
{4DAADA29-C600-4CF3-8AD3-9C97C8D7F632}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4DAADA29-C600-4CF3-8AD3-9C97C8D7F632}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4DAADA29-C600-4CF3-8AD3-9C97C8D7F632}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4DAADA29-C600-4CF3-8AD3-9C97C8D7F632}.Release|Any CPU.Build.0 = Release|Any CPU
{91A14CD2-2940-4500-8193-56D37EDDDBAA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{91A14CD2-2940-4500-8193-56D37EDDDBAA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{91A14CD2-2940-4500-8193-56D37EDDDBAA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{91A14CD2-2940-4500-8193-56D37EDDDBAA}.Release|Any CPU.Build.0 = Release|Any CPU
{A11AEF5A-B246-4FE8-8330-06DB73CC8074}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A11AEF5A-B246-4FE8-8330-06DB73CC8074}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A11AEF5A-B246-4FE8-8330-06DB73CC8074}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A11AEF5A-B246-4FE8-8330-06DB73CC8074}.Release|Any CPU.Build.0 = Release|Any CPU
{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

View File

@ -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;
}
}
}

View File

@ -1,82 +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 Boolean HasInterface(this Object o, Type interf) {
foreach(Type item in o.GetType().GetInterfaces()) {
if(item == interf) {
return true;
}
}
return false;
}
internal static void WriteError(String text) {
Console.ForegroundColor = ConsoleColor.Red;
Console.Error.WriteLine("ERROR: " + text);
Console.ResetColor();
}
internal static String ToUpperLower(this String s) {
if(s.Length == 0) {
return "";
}
if(s.Length == 1) {
return s.ToUpper();
}
return s[0].ToString().ToUpper() + s.Substring(1).ToLower();
}
}
}

View File

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

View File

@ -1,4 +0,0 @@
namespace ZwayBot.Interfaces {
interface IForceLoad {
}
}

View File

@ -1,71 +0,0 @@
using System;
using System.Collections.Generic;
using BlubbFish.IoT.Zway;
using BlubbFish.Utils;
namespace ZwayBot {
abstract class AModul {
protected ZwayController zw;
private InIReader settings;
protected Dictionary<String, Dictionary<String, String>> config = new Dictionary<String, Dictionary<String, String>>();
public Boolean HasConfig { get; private set; }
public Boolean ConfigPublic { get; private set; }
public delegate void ModulEvent(Object sender, ModulEventArgs e);
public abstract event ModulEvent Update;
public AModul(ZwayController zway, InIReader settings) {
this.HasConfig = false;
this.ConfigPublic = false;
this.zw = zway;
this.settings = settings;
this.ParseConfig();
}
private void ParseConfig() {
if (this.settings != null) {
this.HasConfig = true;
foreach (String item in this.settings.GetSections(false)) {
this.config.Add(item, this.settings.GetSection(item));
}
if(this.config.ContainsKey("modul")) {
this.ConfigPublic = this.config["modul"].ContainsKey("config") && this.config["modul"]["config"].ToLower() == "public";
}
}
}
public Dictionary<String, Dictionary<String, String>> GetConfig() {
if (this.HasConfig && this.ConfigPublic) {
Dictionary<String, Dictionary<String, String>> ret = new Dictionary<String, Dictionary<String, String>>(this.config);
if(ret.ContainsKey("modul")) {
ret.Remove("modul");
}
return ret;
}
return new Dictionary<String, Dictionary<String, String>>();
}
public virtual void Interconnect(Dictionary<String, AModul> moduls) { }
public virtual void SetInterconnection(String param, Action<Object> hook, Object data) { }
public abstract void Dispose();
internal void SetConfig(Dictionary<String, Dictionary<String, String>> newconf) {
if (this.HasConfig && this.ConfigPublic) {
if (newconf.ContainsKey("modul")) {
newconf.Remove("modul");
}
if (this.config.ContainsKey("modul")) {
newconf.Add("modul", this.config["modul"]);
}
this.config = newconf;
this.settings.SetSections(this.config);
this.UpdateConfig();
}
}
protected abstract void UpdateConfig();
}
}

View File

@ -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.config.Count != 0) {
foreach (KeyValuePair<String, Dictionary<String, String>> item in this.config) {
if (item.Value.ContainsKey("cron") && item.Value.ContainsKey("set") && this.ParseCronString(item.Value["cron"])) {
this.SetValues(item.Value["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,120 +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));
}
protected override void UpdateConfig() { }
#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) { }
}
}

View File

@ -1,55 +1,58 @@
using System;
using System.Collections.Generic;
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;
using LitJson;
namespace ZwayBot.Moduls {
class Mqtt : AModul, IDisposable {
private ABackend mqtt;
private Dictionary<String, AModul> modules;
namespace BlubbFish.IoT.Bots.ZwayBot.Moduls {
class Mqtt : Mqtt<ZwayController> {
public override event ModulEvent Update;
public Mqtt(ZwayController zway, InIReader settings) : base(zway, settings) {
if (this.config.ContainsKey("settings")) {
this.mqtt = ABackend.GetInstance(this.config["settings"], ABackend.BackendType.Data);
this.mqtt.MessageIncomming += this.Mqtt_MessageIncomming;
this.zw.Update += this.ZwayEvent;
public Mqtt(ZwayController lib, InIReader settings) : base(lib, settings) { }
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()));
}
}
} catch (Exception e) {
Helper.WriteError("BlubbFish.IoT.Bots.ZwayBot.Moduls.Mqtt.LibUpadteThread: " + e.Message);
}
}
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();
}
if(topic != "" && data != "") {
((ADataBackend)this.mqtt).Send(topic, data);
this.Update?.Invoke(this, new MqttEvent(topic, data));
}
}
private void Mqtt_MessageIncomming(Object sender, BackendEvent e) {
#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) {
if (m.Groups[1].Success) {
id = m.Groups[1].Value + "-" + m.Groups[2].Value + "-" + m.Groups[3].Value;
}
if(m.Groups[4].Success) {
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.zw.GetCommandClass(id);
if(c == null) {
ACommandClass c = this.library.GetCommandClass(id);
if (c == null) {
return;
}
if (e.From.ToString().EndsWith("/set")) {
@ -63,71 +66,18 @@ namespace ZwayBot.Moduls {
}
}
} catch (Exception) { }
} else if(e.From.ToString().EndsWith("/get")) {
} 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"));
}
}
if (e.From.ToString().StartsWith("zwavebot/config/") && (e.From.ToString().EndsWith("/set") || e.From.ToString().EndsWith("/get"))) {
Match m = new Regex("^zwavebot/config/(\\w+)/[gs]et$|").Match(e.From.ToString());
if (!m.Groups[1].Success) {
return;
}
AModul modul = null;
foreach (KeyValuePair<String, AModul> item in this.modules) {
if (item.Key.ToLower() == m.Groups[1].Value) {
modul = item.Value;
Tuple<Boolean, MqttEvent> cs = this.ChangeConfig(e, "zwavebot/config/");
if (cs.Item1) {
this.Update?.Invoke(this, cs.Item2);
}
}
if (modul == null) {
return;
}
if(e.From.ToString().EndsWith("/get") && modul.HasConfig && modul.ConfigPublic) {
String topic = "zwavebot/config/" + m.Groups[1].Value;
String data = JsonMapper.ToJson(modul.GetConfig()).ToString();
((ADataBackend)this.mqtt).Send(topic, data);
this.Update?.Invoke(this, new MqttEvent(topic, data));
}
if (e.From.ToString().EndsWith("/set") && modul.HasConfig && modul.ConfigPublic) {
try {
JsonData a = JsonMapper.ToObject(e.Message);
Dictionary<String, Dictionary<String, String>> newconf = new Dictionary<String, Dictionary<String, String>>();
foreach (String section in a.Keys) {
Dictionary<String, String> sectiondata = new Dictionary<String, String>();
foreach (String item in a[section].Keys) {
sectiondata.Add(item, a[section][item].ToString());
}
newconf.Add(section, sectiondata);
}
modul.SetConfig(newconf);
this.Update?.Invoke(this, new MqttEvent("New Config", "Write"));
} catch (Exception) { }
}
}
}
public override void Interconnect(Dictionary<String, AModul> moduls) {
this.modules = moduls;
}
protected override void UpdateConfig() { }
#region IDisposable Support
private Boolean disposedValue = false;
protected virtual void Dispose(Boolean disposing) {
if (!this.disposedValue) {
if (disposing) {
this.mqtt.Dispose();
}
this.disposedValue = true;
}
}
public override void Dispose() {
Dispose(true);
GC.SuppressFinalize(this);
} catch { }
}
#endregion
}

View File

@ -1,102 +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 (KeyValuePair<String, Dictionary<String, String>> item in this.config) {
if (item.Value.ContainsKey("from")) {
String from = item.Value["from"];
String[] source = from.Split(':');
this.events.Add(source[0], item.Value);
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 { }
}
if (dictionary.ContainsKey("to")) {
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));
}
}
}
}
protected override void UpdateConfig() { }
#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() { }
}
}

View File

@ -1,64 +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 ZwayBot.Moduls {
class Senml : AModul {
namespace BlubbFish.IoT.Bots.ZwayBot.Moduls {
class Senml : Mqtt {
public override event ModulEvent Update;
private ABackend mqtt;
private String SenmlGuid;
private readonly String SenmlGuid;
public Senml(ZwayController zway, InIReader settings) : base(zway, settings) {
if (this.config.ContainsKey("settings")) {
this.mqtt = ABackend.GetInstance(this.config["settings"], ABackend.BackendType.Data);
this.mqtt.MessageIncomming += this.EventInput;
this.zw.Update += this.EventOutput;
this.SenmlGuid = this.config["settings"]["guid"];
}
}
#region Events
private void EventOutput(Object sender, DeviceUpdateEvent e) {
String topic = "";
String data = "";
if (e.Parent.HasInterface(typeof(ISenml))) {
ISenml sensor = (ISenml)e.Parent;
topic = sensor.SenmlTopic() + this.SenmlGuid+ "/senml";
data = sensor.ToSenml();
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()));
}
if (topic != "" && data != null && data != "") {
((ADataBackend)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 EventInput(Object sender, BackendEvent e) { }
#endregion
#region Config
protected override void UpdateConfig() { }
#endregion
#region IDisposable Support
private Boolean disposedValue = false;
protected virtual void Dispose(Boolean disposing) {
if (!this.disposedValue) {
if (disposing) {
this.mqtt.Dispose();
}
this.disposedValue = true;
}
}
public override void Dispose() {
Dispose(true);
GC.SuppressFinalize(this);
}
protected override void MqttUpdate(Object sender, BackendEvent e) { }
#endregion
}
}

View File

@ -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.config.Count != 0) {
foreach (KeyValuePair<String, Dictionary<String, String>> section in this.config) {
if (section.Value.ContainsKey("cron") && section.Value.ContainsKey("devices")) {
item.Value.SetInterconnection(section.Value["cron"], new Action<Object>(this.PollSpecific), section.Value["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,8 +39,8 @@ namespace ZwayBot.Moduls {
this.Update?.Invoke(this, new StatusPollingEvent("Polling", "all nodes"));
}
protected override void UpdateConfig() { }
public override void EventLibSetter() { }
public override void Dispose() {}
protected override void LibUpadteThread(Object state) { }
}
}

View File

@ -1,95 +1,56 @@
using System;
using System.Collections.Generic;
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 readonly ZwayController zw;
private readonly Dictionary<String, AModul> moduls = new Dictionary<String, AModul>();
private Boolean RunningProcess = true;
private readonly ProgramLogger logger = new ProgramLogger();
public Program(String[] args) : base(args, true, "zwaybot") {
Console.WriteLine("BlubbFish.IoT.Bots.ZwayBot.Program.Constructor()");
public Program(String[] args) {
InIReader.SetSearchPath(new List<String>() { "/etc/zwaybot", Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\zwaybot" });
Dictionary<String, String> names;
Dictionary<String, ReadOnlyDictionary<String, String>> names = new Dictionary<String, ReadOnlyDictionary<String, String>>();
if(InIReader.ConfigExist("names")) {
names = InIReader.GetInstance("names").GetSection("names");
} else {
names = new Dictionary<String, String>();
foreach(String item in InIReader.GetInstance("names").GetSections(false)) {
names.Add(item, new ReadOnlyDictionary<String, String>( InIReader.GetInstance("names").GetSection(item)));
}
}
if(!InIReader.ConfigExist("settings")) {
Helper.WriteError("No settings.ini found. Abord!");
return;
}
this.logger.SetPath(InIReader.GetInstance("settings").GetValue("logging", "path"));
this.zw = new ZwayController(InIReader.GetInstance("settings").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() {
Console.CancelKeyPress += new ConsoleCancelEventHandler(this.SetupShutdown);
while (this.RunningProcess) {
System.Threading.Thread.Sleep(100);
}
}
private void SetupShutdown(Object sender, ConsoleCancelEventArgs e) {
e.Cancel = true;
this.RunningProcess = false;
}
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 (InIReader.ConfigExist(name.ToLower())) {
this.moduls.Add(name, (AModul)t.GetConstructor(new Type[] { typeof(ZwayController), typeof(InIReader) }).Invoke(new Object[] { this.zw, InIReader.GetInstance(name.ToLower()) }));
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());
}
}
}
}

View File

@ -1,38 +0,0 @@
using System.Reflection;
using System.Resources;
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 - 15.05.2018")]
[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
//
// 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.4.1")]
[assembly: AssemblyFileVersion("1.4.1")]
[assembly: NeutralResourcesLanguage("de-DE")]
// “Internet Of Things” icon by By Michael Wohlwend, US, from thenounproject.com.

View File

@ -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));
}
}
}
}

View File

@ -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>

View File

@ -1,163 +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="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>
<None Include="dpkg\preinst" />
<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\Mqtt.cs" />
<Compile Include="Moduls\Overtaker.cs" />
<Compile Include="Moduls\Senml.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="..\..\Librarys\litjson\litjson\litjson_4.7.1.csproj">
<Project>{91a14cd2-2940-4500-8193-56d37edddbaa}</Project>
<Name>litjson_4.7.1</Name>
</ProjectReference>
<ProjectReference Include="..\..\Utils\IoT\Connector\Data\Mqtt\ConnectorDataMqtt.csproj">
<Project>{ee6c8f68-ed46-4c1c-abdd-cfcdf75104f2}</Project>
<Name>ConnectorDataMqtt</Name>
</ProjectReference>
<ProjectReference Include="..\..\Utils\IoT\Interfaces\Iot-Interfaces.csproj">
<Project>{4daada29-c600-4cf3-8ad3-9c97c8d7f632}</Project>
<Name>Iot-Interfaces</Name>
</ProjectReference>
<ProjectReference 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="control\control.sh">
<None Update="config-example\cronjob.conf">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="control\join.sh">
<None Update="config-example\mqtt.conf">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="control\loop.sh">
<None Update="config-example\names.conf">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="control\restart.sh">
<None Update="config-example\overtaker.conf">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="control\settings.cfg">
<None Update="config-example\senml.conf">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="control\start.sh">
<None Update="config-example\settings.conf">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="control\stop.sh">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="control\stuff.sh">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="control\view.sh">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="config-example\cronjob.conf.example">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="config-example\names.conf.example">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="config-example\senml.conf.example">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="config-example\settings.conf.example">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="config-example\statuspolling.conf.example">
<None Update="config-example\statuspolling.conf">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<None Include="config-example\mqtt.conf.example">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="config-example\overtaker.conf.example">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="dpkg\control" />
<None Include="dpkg\create-Builds.bat" />
<None Include="dpkg\make-deb.sh" />
<None Include="dpkg\prerm" />
<None Include="dpkg\zwaybot.service" />
<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.

View File

@ -1,10 +0,0 @@
[modul]
config=public
[cold]
cron=0 23 * * 0-4
set=7-0-67-2:Level-19;7-0-112-8:Level-2
[hot]
cron=0 16 * * 1-5
set=7-0-67-1:Level-22;7-0-112-8:Level-1

View File

@ -1,6 +0,0 @@
[modul]
config=private
[settings]
type=mqtt
server=localhost

View File

@ -1,24 +0,0 @@
[names]
2-0-37=Kühlschrank Schalter
2-0-49-4=Kühlschrank Leistung
2-0-50-0=Kühlschrank Verbrauch [kWh]
2-0-50-2=Kühlschrank Verbrauch [Wh]
2-0-112-1=Kühlschrank Config (Immer AN)
2-0-112-16=Kühlschrank Config (Zurück zu altem Status nach Stromausfall)
2-0-112-34=Kühlschrank Config (Reaktion auf Alarm)
2-0-112-35=Kühlschrank Config (Antwort auf Alarmmeldung)
2-0-112-39=Kühlschrank Config (Alarm Dauer)
2-0-112-40=Kühlschrank Config (Sofortiger Bericht über Stromverbrauch)
2-0-112-42=Kühlschrank Config (Änderung der Leistung zum Generieren eines Reports)
2-0-112-43=Kühlschrank Config (Regelmäßiges Senden eines Reports über die Stromaufnahme)
2-0-112-45=Kühlschrank Config (Automatisches Senden eines Reportes über Stromverbrauch bei Verbrauchsänderung)
2-0-112-47=Kühlschrank Config (Zeitinterval zum Senden eines Reportes ohne Änderung im Verbrauch)
2-0-112-49=Kühlschrank Config (Messen des Eigenstromverbrauches)
2-0-112-50=Kühlschrank Config (unterer Leistungsschwellwert)
2-0-112-51=Kühlschrank Config (oberer Leistungsschwellwert)
2-0-112-52=Kühlschrank Config (Aktion bei Erreichen des definierten Schwellwertes (Parameter 50/51))
2-0-112-60=Kühlschrank Config (Leistungsschwellwert für violettes Blinken)
2-0-112-61=Kühlschrank Config (LED Ring Farbe im Einschaltzustand)
2-0-112-62=Kühlschrank Config (LED Ring Farbe im Ausschaltzustand)
2-0-112-63=Kühlschrank Config (LED Ring Farbe bei Z-Wave Alarmmeldungen)
2-0-112-70=Kühlschrank Config (Überlastabschaltung)

View File

@ -1,12 +0,0 @@
[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

View File

@ -1,7 +0,0 @@
[modul]
config=private
[settings]
type=mqtt
server=localhost
guid=linksmart-zwaybot

View File

@ -1,7 +0,0 @@
[zway]
server=localhost
user=admin
pass=pass
[logging]
path=/var/log/zwaybot.log

View File

@ -1,3 +0,0 @@
[temp]
cron=30 * * * *
devices=7-0-49-1,8-0-49-1,9-0-49-1,10-0-49-1,11-0-49-1

View File

@ -1,92 +0,0 @@
#!/bin/bash
# Read Settings
DIR=`dirname $0`
source $DIR/settings.cfg
cd $control_root
for(( ; ; ))
do
# Test for Running Servers
servers=$(./view.sh | grep $screen_name)
clear
if [[ -z $servers ]];
then
echo "Zway-Bot not Running!"
echo ""
echo "1) Start Zway-Bot"
else
echo "Zway-Bot is Running :)"
echo ""
echo "2) Stop Zway-Bot"
echo "3) Restart Zway-Bot"
echo "4) Attach to Servers Screen-Session"
echo "5) Put Command to Zway-Bot"
fi
echo "q) Quit"
echo ""
read -p "Choice: " choice
case "$choice" in
q) #Quit
exit 0
;;
1) #Start Server
if [[ -z $servers ]];
then
echo "Starting Zway-Bot..."
./start.sh
else
echo "Zway-Bot Allready started!"
fi
;;
2) #Stop Server
if [[ -z $servers ]];
then
echo "Zway-Bot is not Running!"
else
echo "Stopping Zway-Bot..."
./stop.sh
fi
;;
3) #Restart Server
if [[ -z $servers ]];
then
echo "Zway-Bot is not Running!"
else
echo "Restarting Zway-Bot..."
./restart.sh
fi
;;
4) #Attach to Screen
if [[ -z $servers ]];
then
echo "Zway-Bot is not Running!"
else
./join.sh
fi
;;
5) #Put Command to Server
if [[ -z $servers ]];
then
echo "Zway-Bot is not Running!"
else
read -p "Please enter Zway-Bot-Command: " mc_cmd
./stuff.sh "$mc_cmd"
fi
;;
*) #Invalid Selection
echo "Wrong Selection!"
;;
esac
done

View File

@ -1,10 +0,0 @@
#!/bin/bash
# Read Settings
DIR=`dirname $0`
source $DIR/settings.cfg
echo Press STRG+A then D to detach from Console
read -p "Press [Enter] to continue..."
screen -R $screen_name

View File

@ -1,21 +0,0 @@
#!/bin/bash
# Read Settings
DIR=`dirname $0`
source $DIR/settings.cfg
rm $control_root/stop_server.info
for(( ; ; ))
do
if [ ! -e $control_root/stop_server.info ];
then
cd $mc_root
$mc_cmd
else
echo "Stopped Server!"
break
fi
done
rm $control_root/stop_server.info

View File

@ -1,28 +0,0 @@
#!/bin/bash
# Read Settings
DIR=`dirname $0`
source $DIR/settings.cfg
cd $control_root
# Be Shure theere is no Stop-Info
rm $control_root/stop_server.info
echo "Server will be restarted in 5 Seconds..."
./stuff.sh "/say ReStarting Server in 5 seconds!"
sleep 1
echo "4..."
./stuff.sh "/say 4..."
sleep 1
echo "3..."
./stuff.sh "/say 3..."
sleep 1
echo "2..."
./stuff.sh "/say 2..."
sleep 1
echo "1..."
./stuff.sh "/say 1..."
sleep 1
echo "Restarting Server..."
./stuff.sh "/say Restart Now!"
./stuff.sh "stop"

View File

@ -1,23 +0,0 @@
#!/bin/bash
# Minecraft Control-Scripts Config-File
# (please remember that there are no spaces allowed around the =-Sign
# in the config-lines)
# Minecraft-Dir & JAR
# Directory where minecraft is in
mc_root="/home/pi/Zway-Bot"
# Root of Control-Scripts
control_root="$mc_root/control"
# MC-Server-Jar (will be executed in mc_root)
mc_jar="$mc_root/Zway-Bot.exe"
# MC-Server Start-Command
mc_cmd="mono $mc_jar"
# Screen
screen_name="Zway-Bot"

View File

@ -1,14 +0,0 @@
#!/bin/bash
# Read Settings
DIR=`dirname $0`
source $DIR/settings.cfg
# Start Loop in Screen
screen -A -m -d -S $screen_name $control_root/loop.sh
# Allow other users to control this screen-Session!
screen -r $screen_name -X multiuser on
screen -r $screen_name -X addacl www-data
screen -r $screen_name -X addacl mc
screen -r $screen_name -X addacl mw

View File

@ -1,13 +0,0 @@
#!/bin/bash
# Read Settings
DIR=`dirname $0`
source $DIR/settings.cfg
cd $control_root
# Create Stop-Info!
touch $control_root/stop_server.info
echo "Shuting Down Server..."
./stuff.sh "/exit"
screen -R $screen_name

View File

@ -1,10 +0,0 @@
#!/bin/bash
# Read Settings
DIR=`dirname $0`
source $DIR/settings.cfg
# screen -r $screen_name -X stuff "$1\n"
screen -p 0 -S $screen_name -X eval "stuff '$1'\015"
# as_user "screen -p 0 -S minecraft -X eval 'stuff \"$command\"\015'"

View File

@ -1,3 +0,0 @@
#!/bin/bash
screen -ls

Binary file not shown.

View 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

View File

@ -1,10 +0,0 @@
[modul]
config=public
[cold]
cron=0 23 * * 0-4
set=7-0-67-2:Level-19;7-0-112-8:Level-2
[hot]
cron=0 16 * * 1-5
set=7-0-67-1:Level-22;7-0-112-8:Level-1

View File

@ -0,0 +1,7 @@
[modul]
enabled=false
config=private
[settings]
type=mqtt
server=localhost

View File

@ -1,6 +0,0 @@
[modul]
config=private
[settings]
type=mqtt
server=localhost

View 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

View File

@ -1,24 +0,0 @@
[names]
2-0-37=Kühlschrank Schalter
2-0-49-4=Kühlschrank Leistung
2-0-50-0=Kühlschrank Verbrauch [kWh]
2-0-50-2=Kühlschrank Verbrauch [Wh]
2-0-112-1=Kühlschrank Config (Immer AN)
2-0-112-16=Kühlschrank Config (Zurück zu altem Status nach Stromausfall)
2-0-112-34=Kühlschrank Config (Reaktion auf Alarm)
2-0-112-35=Kühlschrank Config (Antwort auf Alarmmeldung)
2-0-112-39=Kühlschrank Config (Alarm Dauer)
2-0-112-40=Kühlschrank Config (Sofortiger Bericht über Stromverbrauch)
2-0-112-42=Kühlschrank Config (Änderung der Leistung zum Generieren eines Reports)
2-0-112-43=Kühlschrank Config (Regelmäßiges Senden eines Reports über die Stromaufnahme)
2-0-112-45=Kühlschrank Config (Automatisches Senden eines Reportes über Stromverbrauch bei Verbrauchsänderung)
2-0-112-47=Kühlschrank Config (Zeitinterval zum Senden eines Reportes ohne Änderung im Verbrauch)
2-0-112-49=Kühlschrank Config (Messen des Eigenstromverbrauches)
2-0-112-50=Kühlschrank Config (unterer Leistungsschwellwert)
2-0-112-51=Kühlschrank Config (oberer Leistungsschwellwert)
2-0-112-52=Kühlschrank Config (Aktion bei Erreichen des definierten Schwellwertes (Parameter 50/51))
2-0-112-60=Kühlschrank Config (Leistungsschwellwert für violettes Blinken)
2-0-112-61=Kühlschrank Config (LED Ring Farbe im Einschaltzustand)
2-0-112-62=Kühlschrank Config (LED Ring Farbe im Ausschaltzustand)
2-0-112-63=Kühlschrank Config (LED Ring Farbe bei Z-Wave Alarmmeldungen)
2-0-112-70=Kühlschrank Config (Überlastabschaltung)

View 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

View File

@ -1,12 +0,0 @@
[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

View File

@ -1,4 +1,5 @@
[modul]
[modul]
enabled=false
config=private
[settings]

View File

@ -0,0 +1,9 @@
[zway]
server=localhost
user=admin
pass=pass
type=zway
[logging]
path=/var/log/zwaybot/debug.log
debug=false

View File

@ -1,7 +0,0 @@
[zway]
server=localhost
user=admin
pass=pass
[logging]
path=/var/log/zwaybot.log

View 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

View File

@ -1,3 +0,0 @@
[temp]
cron=30 * * * *
devices=7-0-49-1,8-0-49-1,9-0-49-1,10-0-49-1,11-0-49-1

View File

@ -1,92 +0,0 @@
#!/bin/bash
# Read Settings
DIR=`dirname $0`
source $DIR/settings.cfg
cd $control_root
for(( ; ; ))
do
# Test for Running Servers
servers=$(./view.sh | grep $screen_name)
clear
if [[ -z $servers ]];
then
echo "Zway-Bot not Running!"
echo ""
echo "1) Start Zway-Bot"
else
echo "Zway-Bot is Running :)"
echo ""
echo "2) Stop Zway-Bot"
echo "3) Restart Zway-Bot"
echo "4) Attach to Servers Screen-Session"
echo "5) Put Command to Zway-Bot"
fi
echo "q) Quit"
echo ""
read -p "Choice: " choice
case "$choice" in
q) #Quit
exit 0
;;
1) #Start Server
if [[ -z $servers ]];
then
echo "Starting Zway-Bot..."
./start.sh
else
echo "Zway-Bot Allready started!"
fi
;;
2) #Stop Server
if [[ -z $servers ]];
then
echo "Zway-Bot is not Running!"
else
echo "Stopping Zway-Bot..."
./stop.sh
fi
;;
3) #Restart Server
if [[ -z $servers ]];
then
echo "Zway-Bot is not Running!"
else
echo "Restarting Zway-Bot..."
./restart.sh
fi
;;
4) #Attach to Screen
if [[ -z $servers ]];
then
echo "Zway-Bot is not Running!"
else
./join.sh
fi
;;
5) #Put Command to Server
if [[ -z $servers ]];
then
echo "Zway-Bot is not Running!"
else
read -p "Please enter Zway-Bot-Command: " mc_cmd
./stuff.sh "$mc_cmd"
fi
;;
*) #Invalid Selection
echo "Wrong Selection!"
;;
esac
done

View File

@ -1,10 +0,0 @@
#!/bin/bash
# Read Settings
DIR=`dirname $0`
source $DIR/settings.cfg
echo Press STRG+A then D to detach from Console
read -p "Press [Enter] to continue..."
screen -R $screen_name

View File

@ -1,21 +0,0 @@
#!/bin/bash
# Read Settings
DIR=`dirname $0`
source $DIR/settings.cfg
rm $control_root/stop_server.info
for(( ; ; ))
do
if [ ! -e $control_root/stop_server.info ];
then
cd $mc_root
$mc_cmd
else
echo "Stopped Server!"
break
fi
done
rm $control_root/stop_server.info

View File

@ -1,28 +0,0 @@
#!/bin/bash
# Read Settings
DIR=`dirname $0`
source $DIR/settings.cfg
cd $control_root
# Be Shure theere is no Stop-Info
rm $control_root/stop_server.info
echo "Server will be restarted in 5 Seconds..."
./stuff.sh "/say ReStarting Server in 5 seconds!"
sleep 1
echo "4..."
./stuff.sh "/say 4..."
sleep 1
echo "3..."
./stuff.sh "/say 3..."
sleep 1
echo "2..."
./stuff.sh "/say 2..."
sleep 1
echo "1..."
./stuff.sh "/say 1..."
sleep 1
echo "Restarting Server..."
./stuff.sh "/say Restart Now!"
./stuff.sh "stop"

View File

@ -1,23 +0,0 @@
#!/bin/bash
# Minecraft Control-Scripts Config-File
# (please remember that there are no spaces allowed around the =-Sign
# in the config-lines)
# Minecraft-Dir & JAR
# Directory where minecraft is in
mc_root="/home/pi/Zway-Bot"
# Root of Control-Scripts
control_root="$mc_root/control"
# MC-Server-Jar (will be executed in mc_root)
mc_jar="$mc_root/Zway-Bot.exe"
# MC-Server Start-Command
mc_cmd="mono $mc_jar"
# Screen
screen_name="Zway-Bot"

View File

@ -1,14 +0,0 @@
#!/bin/bash
# Read Settings
DIR=`dirname $0`
source $DIR/settings.cfg
# Start Loop in Screen
screen -A -m -d -S $screen_name $control_root/loop.sh
# Allow other users to control this screen-Session!
screen -r $screen_name -X multiuser on
screen -r $screen_name -X addacl www-data
screen -r $screen_name -X addacl mc
screen -r $screen_name -X addacl mw

View File

@ -1,13 +0,0 @@
#!/bin/bash
# Read Settings
DIR=`dirname $0`
source $DIR/settings.cfg
cd $control_root
# Create Stop-Info!
touch $control_root/stop_server.info
echo "Shuting Down Server..."
./stuff.sh "/exit"
screen -R $screen_name

View File

@ -1,10 +0,0 @@
#!/bin/bash
# Read Settings
DIR=`dirname $0`
source $DIR/settings.cfg
# screen -r $screen_name -X stuff "$1\n"
screen -p 0 -S $screen_name -X eval "stuff '$1'\015"
# as_user "screen -p 0 -S minecraft -X eval 'stuff \"$command\"\015'"

View File

@ -1,3 +0,0 @@
#!/bin/bash
screen -ls

View File

@ -1,10 +0,0 @@
Package: zwaybot
Version: x.x-x
Section: base
Priority: optional
Architecture: any
Depends: mono-complete (>= 5.4.1.6)
Maintainer: BlubbFish <dev@blubbfish.net>
Description: Zway-Bot
Zway-Bot manage a Zwave.me installation
so that it has more features

View File

@ -1,6 +1,3 @@
set /P maj=Enter Major Version:
set /P min=Enter Minor Version:
set /P bui=Enter Build Version:
bash.exe -c "./make-deb.sh %maj% %min% %bui%"
bash.exe -c "./make-deb.sh"
bash.exe -c "./make-exe.sh"
pause

View File

@ -1,34 +1,44 @@
#!/bin/bash
WORKDIR="/home/blubb"
ROOT="$WORKDIR/deb"
OUTPUT="../bin/Release"
EXEC="$ROOT/usr/local/bin/zwaybot"
CONFIG="$ROOT/etc/zwaybot"
SYSTEMD="$ROOT/etc/systemd/system"
DEBIAN="$ROOT/DEBIAN"
VMAJOR=$1
VMINOR=$2
VBUILD=$3
mkdir -p $EXEC
mkdir -p $CONFIG
mkdir -p $DEBIAN
mkdir -p $SYSTEMD
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 control $DEBIAN
cp preinst $DEBIAN
cp prerm $DEBIAN
sed -i s/Version:\ x\.x-x/"Version: $VMAJOR.$VMINOR-$VBUILD"/ $DEBIAN/control
chmod 755 $DEBIAN -R
mkdir -p ../deb
mkdir -p ../Builds
cp zwaybot.service $SYSTEMD
chmod 755 $SYSTEMD -R
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)"
cp $OUTPUT/*.exe $EXEC/
cp $OUTPUT/*.dll $EXEC/
cp $OUTPUT/config-example/* $CONFIG
cp $OUTPUT/control $EXEC/ -r
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"
dpkg-deb --build $ROOT
mv $WORKDIR/deb.deb ../bin/Builds/"zwaybot_$VMAJOR.$VMINOR-$VBUILD.deb"
rm $WORKDIR/deb -r
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

View File

@ -1 +1,96 @@
Name "Example1"
;--------------------------------
;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
View 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"

View File

@ -1,4 +0,0 @@
#!/bin/sh
service zwaybot stop
adduser --system zwaybot

View File

@ -1,3 +0,0 @@
#!/bin/bash
service zwaybot stop

View File

@ -1,17 +0,0 @@
# If you modify this, please also make sure to edit init.sh
[Unit]
Description=Zway-Bot manage a Zwave.me installation so that it has more features
After=network-online.target
[Service]
User=zwaybot
Group=zwaybot
WorkingDirectory=/usr/local/bin/zwaybot
ExecStart=/usr/bin/mono /usr/local/bin/zwaybot/Zway-Bot.exe
KillMode=control-group
Restart=on-failure
[Install]
WantedBy=multi-user.target
Alias=zwaybot.service