Skip to content

Commit

Permalink
- upgrades pymodbus to v3.5.0
Browse files Browse the repository at this point in the history
- adds compatibility to the upcoming matplotlib 3.8
- adds Idempotency-Key header to plus POST requests
- adds Hottop device logging
- fixes shortcut documentation
- fixes item color handling in Comparator
- typing updates
  • Loading branch information
MAKOMO committed Sep 10, 2023
1 parent 84675b1 commit 68f27ab
Show file tree
Hide file tree
Showing 76 changed files with 49,529 additions and 49,152 deletions.
Binary file modified doc/help_dialogs/Input_files/keyboardshortcuts.xlsx
Binary file not shown.
14 changes: 7 additions & 7 deletions doc/help_dialogs/Output_html/keyboardshortcuts_help.html
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,12 @@
<td>Set selected slider to minimum or maximum value</td>
<td>Requires Keyboard Control enabled in Config&gt;&gt; Events<br>Keyboard Shortcuts must be disabled (ENTER)</td>
</tr>
<tr>
<td>Click on timer</td>
<td>Simulator</td>
<td>Toggle Pause/Continue Simulation</td>
<td>Simulator speed may be changd while paused (hold shift (1x), OPTION/ALT (2x) or COMMAND/CTRL (4x) on restart).</td>
</tr>
<tr>
<td>OPTION Tools&gt;&gt;Simulator [Mac]<br>ALT Tools&gt;&gt;Simulator [Win]</td>
<td>Graph/Simulator</td>
Expand All @@ -289,12 +295,6 @@
<td>Start or change Simulator speed to 4x mode</td>
<td>&#160;</td>
</tr>
<tr>
<td>Click on timer</td>
<td>Simulator</td>
<td>Toggle Pause/Continue Simulation</td>
<td>Simulator speed may be changd while paused. See next two shortcuts.</td>
</tr>
<tr>
<td>⌘+L [Mac]<br>CTRL+L [Win]</td>
<td>Roast Properties Roast tab</td>
Expand Down Expand Up @@ -473,4 +473,4 @@
<td>Open QuickStart Guide in the system browser</td>
</tr>
</tbody>
</table></body>
</table></body>
58 changes: 30 additions & 28 deletions src/artisanlib/aillio.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,12 @@
import usb.core # type: ignore
import usb.util # type: ignore

import requests
from requests_file import FileAdapter # type: ignore # @UnresolvedImport
import json
import array
from lxml import html # type: ignore

#import requests
#from requests_file import FileAdapter # type: ignore # @UnresolvedImport
#import json
#from lxml import html # unused

import logging
from typing import Optional, TYPE_CHECKING
Expand All @@ -40,7 +41,8 @@
except ImportError:
from multiprocessing.connection import Connection # type:ignore # pylint: disable=unused-import
from artisanlib.types import ProfileData # pylint: disable=unused-import

from artisanlib.main import ApplicationWindow # pylint: disable=unused-import
# from PyQt6.QtCore import QUrl # pylint: disable=unused-import

try:
from PyQt6.QtCore import QDateTime, Qt # @UnusedImport @Reimport @UnresolvedImport
Expand Down Expand Up @@ -406,7 +408,7 @@ def __readreply(self, length):
return self.usbhandle.read(self.AILLIO_ENDPOINT_RD, length)
raise OSError('not found or no permission')

def extractProfileBulletDict(data,aw):
def extractProfileBulletDict(data, aw:'ApplicationWindow') -> 'ProfileData':
try:
res:'ProfileData' = {} # the interpreted data set

Expand Down Expand Up @@ -627,28 +629,28 @@ def extractProfileBulletDict(data,aw):
_log.exception(e)
return {}

def extractProfileRoastWorld(url,aw):
s = requests.Session()
s.mount('file://', FileAdapter())
page = s.get(url.toString(), timeout=(4, 15), headers={'Accept-Encoding' : 'gzip'})
tree = html.fromstring(page.content)
data = tree.xpath('//body/script[1]/text()')
data = data[0].split('gon.profile=')
data = data[1].split(';')
res = extractProfileBulletDict(json.loads(data[0]),aw)
if 'beans' not in res:
try:
b = tree.xpath("//div[*='Bean']/*/a/text()")
if b:
res['beans'] = b[0]
except Exception: # pylint: disable=broad-except
pass
return res

def extractProfileRoasTime(file,aw):
with open(file, encoding='utf-8') as infile:
data = json.load(infile)
return extractProfileBulletDict(data,aw)
#def extractProfileRoastWorld(url:'QUrl', aw:'ApplicationWindow') -> Optional['ProfileData']:
# s = requests.Session()
# s.mount('file://', FileAdapter())
# page = s.get(url.toString(), timeout=(4, 15), headers={'Accept-Encoding' : 'gzip'})
# tree = html.fromstring(page.content)_
# data = tree.xpath('//body/script[1]/text()')
# data = data[0].split('gon.profile=')
# data = data[1].split(';')
# res = extractProfileBulletDict(json.loads(data[0]),aw)
# if 'beans' not in res:
# try:
# b = tree.xpath("//div[*='Bean']/*/a/text()")
# if b:
# res['beans'] = b[0]
# except Exception: # pylint: disable=broad-except
# pass
# return res

#def extractProfileRoasTime(file, aw:'ApplicationWindow') -> 'ProfileData':
# with open(file, encoding='utf-8') as infile:
# data = json.load(infile)
# return extractProfileBulletDict(data, aw)

if __name__ == '__main__':
R1 = AillioR1(debug=True)
Expand Down
Loading

0 comments on commit 68f27ab

Please sign in to comment.