-
Notifications
You must be signed in to change notification settings - Fork 663
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
The OPCUA Server sets the Servertimestamp in the moment of writing th… #1197
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ | |
|
||
from opcua import ua | ||
from opcua.server.user_manager import UserManager | ||
|
||
import pytz | ||
|
||
class AttributeValue(object): | ||
|
||
|
@@ -63,6 +63,9 @@ def write(self, params, user=UserManager.User.Admin): | |
if not ua.ua_binary.test_bit(al.Value.Value, ua.AccessLevel.CurrentWrite) or not ua.ua_binary.test_bit(ual.Value.Value, ua.AccessLevel.CurrentWrite): | ||
res.append(ua.StatusCode(ua.StatusCodes.BadUserAccessDenied)) | ||
continue | ||
tz = pytz.timezone('Europe/Berlin') | ||
writevalue.Value.ServerTimestamp = datetime.now(tz) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed. |
||
#writevalue.Value.SourceTimestamp = datetime.now(tz) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No comment is left behind in a PR. ;) You can delte that line, if it is unused. |
||
res.append(self._aspace.set_attribute_value(writevalue.NodeId, writevalue.AttributeId, writevalue.Value)) | ||
return res | ||
|
||
|
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.
I think a fixed timezone "to Europe/Berlin" wouldn't be a good way. Either the servers local time should be passed or handled in another way.
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.
Totally agree!