Added cameras menu: one can get image from camera
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Net.Http;
|
||||
using System.Net.Http.Headers;
|
||||
using System.Text;
|
||||
using System.Text.Json;
|
||||
using System.Threading.Tasks;
|
||||
@@ -10,11 +11,17 @@ namespace ZaoBot.OpenHab
|
||||
class OpenHabClient
|
||||
{
|
||||
private string url;
|
||||
private string token;
|
||||
HttpClient http = new HttpClient();
|
||||
|
||||
public OpenHabClient(string url)
|
||||
public OpenHabClient(string url, string token = "")
|
||||
{
|
||||
this.url = url;
|
||||
this.token = token;
|
||||
if (!string.IsNullOrEmpty(token))
|
||||
{
|
||||
http.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", token + ":");
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<ItemState> GetItemState(string item)
|
||||
|
||||
Reference in New Issue
Block a user