Skip to content

Commit

Permalink
Removed wip parts
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikoh77 committed Sep 19, 2023
1 parent 73bb6d2 commit 2afeb73
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 34 deletions.
24 changes: 0 additions & 24 deletions monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ def query(self, url=None, method='get', data=None):
return None
else:
print(f'OK, done \U0001F44D')
#print(response.text) # for debug purposes only, to be deleted
return response.json()

async def getsnapshot(self, context, chat_id, query):
Expand Down Expand Up @@ -89,26 +88,3 @@ async def configure(self, context, chat_id, query, key, value, desc):
print('unknown parameter')
await context.bot.send_message(chat_id=chat_id, text="Unknown parameter... \u26A0\ufe0f")
return False

# async def likExportedMonitor(self, parameter, value):
# data=self.query()
# if data:
# data=data[0]
# data['details']=json.loads(data['details'])
# print('reassembling monitor...')
# # Needed keys (starting to exported one) to make API query
# keys=['mode', 'mid', 'name', 'tags', 'type', 'protocol', 'host', 'port', 'path', 'height', 'width', 'ext', 'fps', 'details']
# reassembleData={}
# for key in keys:
# reassembleData[key]=data.get(key)
# endpoint = f"{self.shinobiBaseUrl}:{self.shinobiPort}/{self.shinobiApiKey}/configureMonitor/{self.shinobiGroupKey}/{self.mid}"
# if parameter in reassembleData['details']:
# print('ok parameter found')
# reassembleData['details'][parameter]=value
# reassembleData=json.dumps(reassembleData, indent=3)
# print(reassembleData)
# test=self.query(endpoint, 'post', reassembleData)
# else:
# print('unknown parameter')
# await context.bot.send_message(chat_id=chat_id, text="Unknown parameter... \u26A0\ufe0f")
# return False
12 changes: 2 additions & 10 deletions shinogramma.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,17 +167,9 @@ async def callback_handler(update: Update, context: CallbackContext):
elif inputdata[1]=='videos':
await context.bot.send_message(chat_id=chat_id, text='Sorry, it\'s not yet possible to see videos but I am working on... \u26A0\ufe0f')
elif inputdata[1]=='configure':
#test=await thisMonitor.likExportedMonitor('snap', '1')
#print(json.dumps(test, indent=3))
#await configuremonitor_subcommand(update, context, mid, key, value, desc)
await context.bot.send_message(chat_id=chat_id, text='Sorry, it\'s not possible to configure monitors, It\'s not something I can fix without Shinobi\'s dev help... \u26A0\ufe0f')
await context.bot.send_message(chat_id=chat_id, text='Sorry, it\'s not possible to configure monitors, It\'s not something I can fix alone... \u26A0\ufe0f')
elif tag=='configuremonitor':
mid=inputdata[1]
key=inputdata[2]
value=inputdata[3]
desc=inputdata[4]
thisMonitor=monitor(shinobiBaseUrl, shinobiPort, shinobiApiKey, shinobiGroupKey, mid)
await thisMonitor.configure(context, chat_id, query, key, value, desc)
await context.bot.send_message(chat_id=chat_id, text='Sorry, it\'s not possible to configure monitors, It\'s not something I can fix alone... \u26A0\ufe0f')

@restricted
@send_action(constants.ChatAction.TYPING)
Expand Down

0 comments on commit 2afeb73

Please sign in to comment.