【发布时间】:2015-02-26 09:18:12
【问题描述】:
我正在尝试使用 FirebaseSharp 设置恒温器,但没有成功。 我从http://www.codeproject.com/Articles/818265/NET-Works-with-Nest-Guide-to-calling-Nest-API-fro?msg=5010020#xx5010020xx 下载了padmore 的示例。 当我从虚拟设备更改值时,我收到了事件。我也将恒温器设置为读/写。 这就是要做的: 问题是 firebaseClient.Post 和 firebaseClient.Put 被调用并且从未返回。也不例外。
private void buttonPost_Click( object sender, RoutedEventArgs e )
{
string data = "30";
string fullPath = "//devices//thermostats//<device id>//target_temperature_high_c";;
string t;
try
{
t = firebaseClient.Post( fullPath, data );
string i = string.Format( "firebaseClient.Post: {0}", t );
OutMessage( i );
return;
}
catch(Exception ex)
{
string i = string.Format( "firebaseClient.Post: exception {0}", ex.Message );
OutMessage( i );
}
try
{
t = firebaseClient.Put( fullPath, data );
string i = string.Format( "firebaseClient.Put: {0}", t );
OutMessage( i );
}
catch(Exception ex)
{
string i = string.Format( "firebaseClient.Put: exception {0}", ex.Message );
OutMessage( i );
}
}
那我做错了什么? 感谢您的帮助。
【问题讨论】:
-
我对 FirebaseSharp 一无所知,但这似乎不是一个有效的路径://devices//thermostats//
//target_temperature_high_c。您是否忘记将 替换为您的实际 ID? -
- 我写的是这个而不是我的实际设备 ID。