blob: d3644bfb7d253173ee73d6699b4a9c5d872595d9 [file]
/*
* Copyright (c) 2025 Project CHIP Authors
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include <cstdint>
namespace chip::app::Clusters::ValveConfigurationAndControl {
/// Interface for tracking TimeSynchronization cluster status and UTC time availability.
///
/// Required when the ValveConfigurationAndControl cluster enables the TimeSync feature.
/// Per specification, the TimeSync feature shall only be enabled when the
/// TimeSynchronization cluster is present on the device.
///
/// The AutoCloseTime attribute requires valid UTC time from TimeSynchronization.
///
/// Note: This interface is not needed if TimeSync feature is not supported.
class TimeSyncTracker
{
public:
virtual ~TimeSyncTracker() = default;
/// Checks whether UTC time is currently synchronized and valid.
///
/// When TimeSync feature is enabled, implementations must verify that the
/// TimeSynchronization cluster has successfully synchronized time before
/// allowing setting time-based attributes like AutoCloseTime.
///
/// @return true if UTC time is synchronized and valid, false otherwise
virtual bool IsValidUTCTime() = 0;
};
} // namespace chip::app::Clusters::ValveConfigurationAndControl