Skip to content

Commit c40913b

Browse files
committed
roll exists check into feed and dashboard creation
1 parent 7525a21 commit c40913b

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/AdafruitIO_Dashboard.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ bool AdafruitIO_Dashboard::exists()
3939

4040
bool AdafruitIO_Dashboard::create()
4141
{
42+
if(exists())
43+
return true;
44+
4245
String url = "/api/v2/";
4346
url += _io->_username;
4447
url += "/dashboards";

src/AdafruitIO_Feed.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,9 @@ bool AdafruitIO_Feed::exists()
126126

127127
bool AdafruitIO_Feed::create()
128128
{
129+
if(exists())
130+
return true;
131+
129132
String body = "name=";
130133
body += name;
131134

0 commit comments

Comments
 (0)