-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
14_SD_WS.pm: New protocol for Atech wireless weather station #578
Conversation
14_SD_UT.pm: new protocol for Techmar Garden Lights SD_ProtocolData.pm: set protocol 94 to development SD_ProtocolData.pm: new definition protocol 95 README.md: new entries for Tedsen, Geiger and Techmar
Der Travis Build Fehler ist nicht neu, der ist leider schon alt nur aufgrund eines Fehlers nicht aufgetreten. |
Ich hab eben schon nach meiner Version gesehen: |
Du meinst diese Meldung:
Die besagt, dass wir einen hash nicht dereferenzieren können. Seit Perl 5.24 ist das nicht mehr zulässig. |
Ich meinte damit, das FHEM mit dieser Perl-Version bei mir nichts zu mäkeln hat. Die Tests von dir lasse ich hier nicht laufen. |
Ok verstehe. Ich teste lokal auf 5.18. Müsste mir mal überlegen wie ich lokal auch mit anderen Versionen testen könnte. Zum debuggen wäre das einfacher. Ich bin dabei das zu beheben, allerdings komme ich von einem Fehler zum Nächsten :( |
@elektron-bbs Der Ablauf wäre so: |
Muss ich jetzt erneut einen PR tätigen? |
nein, Wir müssen nur deinen Branch mit den Aktualisierungen aus dev-r34 aktualisieren. Soll ich das machen oder weisst Du wie es geht? |
Wie das geht, habe ich bis heute nicht heraus bekommen. Ich habe jetzt meistens bei mir das Repo gelöscht und dann neu geforkt um auf den aktuellen Stand zu kommen. |
Pull Request Test Coverage Report for Build 1470
💛 - Coveralls |
naja, Du müsstest deinen Zweig also elektron-bbs:dev-r34 auschecken und dann sowas wie
Dann legst Du eine neue Vebindung zu dem "haupt" Repo an und implementierst anschließend die Änderungen von dem Hauptrepo in deines. |
without longid: SD_WS_94_T with longids: SD_WS_94_T_0C
Decoding code moved to decodingSubs
Ich hab den Code umgeschrieben. Ich hab vor meine Anpassung und nach meiner Anpassung ein dispatch gemacht. Vorher kam da aber keine Feuchtigkeit. Jetzt kommt eine. Der Sensor sollte das ja auch haben oder?
|
FHEM/14_SD_WS.pm
Outdated
($_[1] = $_[1]) =~ s/110/1/g; | ||
return sprintf('%02X', SD_WS_bin2dec(substr($_[1],0,8))); | ||
}, | ||
bat => sub { return substr($_[1],8,1) eq "0" ? "ok" : "low"; }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wie kommst du darauf, das es ein Batteriebit gäbe? Hast du eine Doku zum Protokoll gefunden? Im Issue Atech wireless weather station findet sich auch kein Hinweis dazu.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hab da wohl zu viel kopiert. Ich werde es wieder entfernen
FHEM/14_SD_WS.pm
Outdated
}; | ||
my $temp = ($rawtemp100 * 10 + $rawtemp10 + $rawtemp1 / 10) * ( substr($_[1],10,1) == 1 ? -1.0 : 1.0); | ||
}, | ||
hum => sub {my (undef,$bitData) = @_; return SD_WS_binaryToNumber($bitData,24,31); }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ich denke nicht, das das ein Feuchtewert sein könnte. Im Issue ist auch nie die Rede davon, das der Sensor eine Feuchte überträgt. Außerdem werden nicht immer 32 Bit übertragen (siehe Excel-Tabelle im Beitrag ).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hab da wohl zu viel kopiert. Ich werde es wieder entfernen
remove wrong added bat and humidity value for model SD_WS_94_T
Ich habe battery und humidity wieder entfernt |
Welche Änderungen möchtest du jetzt noch? |
Wenn zwei editieren, dann ist das immer so eine Sache. Wenn von deiner Seite her meine Anpassungen für dich okay sind dann können wir da einen Haken dran machen. Von meiner Seite ist die Änderungen auch soweit okay. Ich halte eine Ergänzung in der commandref noch für wertvoll welches neue Gerät nun unterstützt wird. Machst Du die noch? |
Kann ich machen. Es gibt nur leider keinerlei sinnvolle Bezeichnung für diese Station/Sensor. Außer dem Hersteller "Atech" ist nichts bekannt. Schreib ich halt "Atech wireless weather station" hin. Der Code funktioniert. Allerdings halte ich es weiterhin für weniger effizient, 6 subs aufzurufen statt eines "if". Kannst du mir den Vorteil erläutern? |
Der Vorteil liegt darin, dass alle Modelle nach dem gleichen Schema verarbeitet werden: Lines 773 to 803 in 27e1ec8
Es ist nicht notwendig, sich mit der Zuweisung von den Variablen oder der Einhaltung einer Reihenfolge beschäftigen. Stattdessen kann man auf diese Blaupause zurückgreifen und kümmert sich "nur" noch darum, dass die passenden Werte aus der Nachricht extrahiert werden. Lines 458 to 475 in 27e1ec8
Ich finde diese elendig langen If / then / Else Blöcke sehr schlecht lesbar und auch schlecht wartbar. |
@elektron-bbs |
@sidey79 |
Wenn ich eine Anregung anbringen dürfte: Der squash Merge commit hat den Zweck, dass man ein commit erzeugt und auch die Beschreibung anpasst. Du hast jetzt diesen commit 79c999c mit folgendem Text hinzugefügt:
Der commit selbst beinhaltet ja nur die absoluten Änderungen zwischen dem feature branch und dem dev-r34 branch. Von protocol 95 ist in dem commit ja jetzt nichts mehr enthalten. Und Anpassungen der Readme habe ich keine gefunden :( Ausreichend und korrekter wäre etwas wie folgt gewesen. Die jetzt vorhandene commit message stimmt ja nicht und beinhaltet Dinge, die nicht im commit nicht enthalten sind.
Wäre es möglich, die Nachricht in Zukunft auf die Endgültige Änderung zu optimieren? |
Sorry, mir war nicht bewusst, das ich die Beschreibung überhaupt editieren kann. Ich werde beim nächsten Mal darauf achten. |
Ja, du kannst einen neuen Branch anlegen. Ich verwende tortoise git. Beim Commit kann man den neuen Branch angeben |
OK. |
feature: 14_SD_WS.pm: New protocol for Atech wireless weather station (protocol #94)
What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
What is the current behavior? (You can also link to an open issue here)
Atech wireless weather station (vermutlicher Name: WS-308) #547
What is the new behavior (if this is a feature change)?
Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)
no
Other information: