Skip to content
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

ViewDescription default Timestamp value should be OPC UA TimeBase #1779

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions asyncua/ua/uaprotocol_auto.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from typing import List, Optional, Type
from dataclasses import dataclass, field

from asyncua.ua.uatypes import FROZEN
from asyncua.ua.uatypes import FROZEN, FILETIME_EPOCH_AS_UTC_DATETIME
from asyncua.ua.uatypes import SByte, Byte, Bytes, ByteString, Int16, Int32, Int64, UInt16, UInt32
from asyncua.ua.uatypes import UInt64, Boolean, Float, Double, Null, String, CharArray, DateTime, Guid
from asyncua.ua.uatypes import AccessLevel, EventNotifier
Expand Down Expand Up @@ -5820,7 +5820,11 @@ class ViewDescription:
data_type = NodeId(ObjectIds.ViewDescription)

ViewId: NodeId = field(default_factory=NodeId)
Timestamp: UtcTime = field(default_factory=lambda: datetime.now(timezone.utc))
# Set the default timestamp to 1601-01-01, which is the OPC UA TimeBase.
# This prevents the "BadViewTimestampInvalid" error in Browse Request Service results,
# indicating that the view timestamp is either unavailable or unsupported.
# https://github.com/FreeOpcUa/opcua-asyncio/issues/654
Timestamp: UtcTime = field(default_factory=lambda: FILETIME_EPOCH_AS_UTC_DATETIME)
ViewVersion: UInt32 = 0


Expand Down
Loading