fetch_item requests unlocked flash

It seems odd that we require a NorFlash object for a read operation instead of a read-only flash. I looked at the code, and it looks like the only case here is that we intentionally erase the flash range if we failed to deserialize a requested item (which doesn't actually seem like what we want to do?).
I propose that we relax the bounds here and make it just request a ReadNorFlash object, which allows us to keep flash locked when reading, which limits the potential for unintended modifications.

Ah yeah, that seems reasonable!
About the erase, yeah idk. At that point something pretty bad went wrong and in principle the data is not recoverable. The only thing you could do to continue is to erase the flash.
But changing it to retuning an error is good too. The users then have to do the erase themselves.

I can look at implementation next week as well - not super pressing here, just looking at integrating this into Stabilizer so we can maintain some settings, and this crossed my mind while implementing :)

Oh cool! 😁

Is it not possible to deserialize items without knowledge of the underlying flash page structuring? It seems like that should be possible.

In theory one could create a library where that's possible yeah, but this crate is designed page-first.
There are three problems if you don't know the page size (and thus can't find the page markers).

Normal data can contain sections with 0xFF. The only contract is that not ALL of them may be 0xFF. So in theory you could have some data with 100 0xFF's while the amount of free space is less than that. This means you can't really determine the difference between them.
You don't know where the page markers are, so they would be considered to be normal data. This will break everything.
We don't know the write word size. So we don't know where to round up to in some cases.

Even if we could maybe fix 1, 2 and 3 are real blockers.
The only option I really see is this:
fn fetch_item<F: NorFlash>() -> () {
    fetch_item_read_only::<F, F::WRITE_SIZE, F::ERASE_SIZE>()
}

fn fetch_item_read_only<F: ReadNorFlash, const WORD_SIZE: usize, const ERASE_SIZE: usize>() -> () {
    // The real impl
}

But that'd have the cost of having to add the generics everywhere

It's only a small portion of this issue, but I created a new release 0.4.2 where the crate doesn't auto-erase anymore and instead returns an error.

I think a more reasonable request would be to attach the flash page size to ReadNorFlash objects in embedded-storage. I don't see why that information is only applicable to writeable flash - I'll open an issue.

Closing this issue for now since the issue is with embedded-storage. If it gets updated so that the erase and write sizes are known in the norflash trait, then the issue can be reopened and I'll update the crate.


[Bug]: the timestamp type in a table, use duckdb_engine to get,  return object

What happened?
CREATE TABLE my_table (id INTEGER, ts TIMESTAMP)
INSERT INTO my_table VALUES (1, '2023-07-15 12:34:56')
SELECT date_trunc('month', ts::TIMESTAMP) as month FROM my_table
use native duckdb to execute the sql , i get "month" as 'datetime' type
use duckdb_engine, i get "month" as 'object' type, it's a bug
DuckDB Engine Version
0.9.2
DuckDB Version

=0.8.0

SQLAlchemy Version
No response
Relevant log output
No response
Code of Conduct

[X] I agree to follow this project's Code of Conduct

Can you please provide the Python code that you are running?

native duckdb
import duckdb
import pandas as pd

conn = duckdb.connect(database=':memory:')

conn.execute("CREATE TABLE my_table (id INTEGER, ts TIMESTAMP)")
conn.execute("INSERT INTO my_table VALUES (1, '2023-07-15 12:34:56')")

mytable =conn.execute("SELECT * as aa FROM my_table").fetchdf()

data = conn.execute("SELECT date_trunc('month', ts::TIMESTAMP) as aa FROM my_table").fetchdf()

print(data.dtypes["aa"])

duckdb_engine
from sqlalchemy import create_engine
import sqlalchemy as sa

eng = create_engine("duckdb:///:memory:").connect()
eng.execute(sa.text("CREATE TABLE my_table (id INTEGER, ts TIMESTAMP)"))
eng.execute(sa.text("INSERT INTO my_table VALUES (1, '2009-01-01T00:00:00.000')"))
data = pd.read_sql("SELECT datetrunc('month', ts) aa FROM my_table", eng)
print(data.dtypes["aa"])

results are not same

For whatever reason, pandas doesn't automatically load datetime.date as a date type. Not sure why.
You can tell it to interpret a given column a date like so though:
data = pd.read_sql("SELECT datetrunc('month', ts) aa FROM my_table", eng, parse_dates=['aa'])


chore: Add browser examples for local testing #110

Adds the following examples

JS Repo - Web-OpenTelemetry-Examples

Adds the following packages (as needed by the above examples)

OTLP Transformer
Exporter Base OTLP
Exporter Zipkin
Exporter Trace OTLP Proto
Exporter Trace OTLP Http
Exporter Metrics OTLP Http
Exporter Logs OTLP Proto
Exporter Logs OTLP Http

PR example from this change #134

Updated PR example from this change #135


Improve Tooltip and Hover Interaction

Significant improvements to the tooltip and hover modes
New Configuration
In addition to the hover.mode and tooltips.mode settings, hover.intersect and tooltips.intersect have been added. The intersect settings are used to configure certain modes so that when items are shown can be controlled
New Modes

Mode
Description

point
Returns all items under the point

index
renamed 'label' mode

nearest
Returns the nearest item. Using in conjunction with intersect set to true works well for points that are hidden behind

x
returns items that intersect the x coordinate

y
returns items that intersect the y coordinate

Point Mode

Nearest Mode, Intersect On

Nearest Mode, No Intersect

Deprecated Modes
The 'single' and 'x-axis' modes are deprecated.
Single mode has been replaced by 'point' which returns all of the items that intersect with the cursor
The X axis mode has been replaced by the index mode coupled with setting intersect to true.

💯 👍 thanks @etimberg

Awesome work, this will make chart interactions much better :) My main concern is about interactions performance, I don't think we should rely on any callback based iterations (see this comment).
Adding a minor cosmetic feedback, which is really a personal preference: when there is no confusion possible, I prefer short variable names which make code easier to read. For example, I would not use chartInstance but simply chart (even in tests since all other tests now use chart). Same for elementsArray -> elements, eventPosition -> position, etc. It would be also more consistent since you don't use elementInstance :) What do you think?

Sounds good. I will make these changes. 😄

@simonbrunel I updated per your code review comments. I agree that we should avoid helpers.each where possible. Since we no longer support IE8 we can even replace a lot of the helpers.each calls with Array.prototype.forEach since it is available on all our platforms.

Agree, helpers.each is only useful when we don't know if it's an array or object. When iterating over the datasets/data, we should use a for loop to avoid the callback cost.

Sure, i will do that refactoring.

@simonbrunel I made the last changes and squashed the refactoring commits together.

Are we good to merge this?


Fix RequestModifier: use modified _builder instead of orignal builder

In the createRequest Method of the Provider class is probably a minor error.
Instead of building the request with the modified _builder variable the original builder
was used. So all modifications are ignored. This PR fixes my issues when adding an Authentication Request Modifier:
This did not work before:
struct AuthenticationMiddleware: RequestModifier {     func modify(req: inout PapyrusCore.RequestBuilder) throws {         req.addAuthorization(RequestBuilder.AuthorizationHeader.bearer(token))     } }

Yep - this was a bug. Thank you!


showUsersLocation not working as expected

<MapView         style={styles.map}         region={this.state.region}         showsUserLocation={true}         onRegionChange={this.onRegionChange}       />
"If true the app will ask for the user's location. NOTE: You need to add NSLocationWhenInUseUsageDescription key in Info.plist to enable geolocation, otherwise it is going to fail silently!" - I have done this also but the Map does not ask for the users location ? Any thoughts of what I am missing here.

Do you have GPS enabled?

Are you running on simulator or real device? On simulator you need to Select: 'Debug -> Location -> Set some location' to get it to work, and maybe restart a couple of times..

https://github.com/react-community/react-native-maps/issues/209#issuecomment-350907665


Type 'Opts' does not satisfy the constraint 'string'.ts(2344)

Throwing error for opts type mismatch
export interface HttpLogger<IM = IncomingMessage, SR = ServerResponse, Opts = Options<IM, SR>> {
(req: IM, res: SR, next?: () => void): void;
logger: pino.Logger;
}
Type 'Opts' does not satisfy the constraint 'string'.ts(2344)
index.d.ts(19, 72): This type parameter might need an extends string constraint.

reproducing on my end as well

Same problem for me

Same problem here. If you doesn't have an old package-lock.json (with correct dependencies), you'll get this error.
help?

Same problem here

A temporary solution:
Install version 8.4 npm i<EMAIL_ADDRESS>Then go to your package-lock.json, and find for "node_modules/pino-http", you'll see the version 8.5.1, then replace for:
    "node_modules/pino-http": {
      "version": "8.4.0",
      "resolved": "https://registry.npmjs.org/pino-http/-/pino-http-8.4.0.tgz",
      "integrity": "sha512-9I1eRLxsujQJwLQTrHBU0wDlwnry2HzV2TlDwAsmZ9nT3Y2NQBLrz+DYp73L4i11vl/eudnFT8Eg0Kp62tMwEw==",
      "dependencies": {
        "get-caller-file": "^2.0.5",
        "pino": "^8.0.0",
        "pino-std-serializers": "^6.0.0",
        "process-warning": "^2.0.0"
      }
    },

And run npm i again.


Encryption support

Hello guys,
Is any kind of encryption supported?
If not, do you have plans for it?
Regards

Apologies for this late answer, but right now there's no plan for it, as this wrap is mostly just in maintenance mode.


Fix crash in Examples-iOS app when tapping "Mixed Data"

Changes in this pull request
Fix crash in Examples-iOS app when tapping "Mixed Data"
Summary:
Make GridItem conform to IGListDiffable now that NSObject+IGListDiffable category has been removed.
Pull request checklist

[x] All tests pass. Demo project builds and runs.
[ ] I added tests, an experiment, or detailed why my change isn't tested.
[x] I have reviewed the contributing guide

Ack, knew something would get missed. We should setup some UI tests for these examples too sometime. Thanks @DRosadoYew! Going to wait on ✅  then land 👍

Changes Unknown when pulling 82e44ecf697e13d71889728fcc9e6abde3a185d7 on DRosadoYew:fix-crash-ios-example into ** on Instagram:master**.

Changes Unknown when pulling 82e44ecf697e13d71889728fcc9e6abde3a185d7 on DRosadoYew:fix-crash-ios-example into ** on Instagram:master**.

thanks @DRosadoYew ! 💯

I agree, would be nice to have some basic UI tests. Will try to get something done.
Don't have a lot of experience in UI testing, any advice @rnystrom ?
Btw, thanks for sharing IGListKit.


Add classnames to title bar action-items

Coverage decreased (-0.1%) to 99.054% when pulling 5287cffaf8a20e70682b9e65f6e86520f675075f on rafaelteixeira:action-items-css into 1017fb2c24168b6db0746278e99d9f85464093b6 on codevise:master.


Implement model loading API

As the title says it, we have to add model loading support. OBJ, MD5 and Collada are planned to be the supported model formats.

[ ] OBJ Loader and Renderer
[ ] MD5 Loader and Renderer
[ ] Collada Loader and Renderer

Postponing this to the next version since the plan changed to make use of Assimp library, which is going to be in LWJGL3 soon, and I'm going to write Assimp bindings to Android (with SWIG) and to HTML5 (Using Emscripten, and then port that to GWT). Once this is done, we can enjoy 3D models from 40+ file formats supported by Assimp.


Testing mounted routers which depend on Route Parameters

First of all, thanks for the great framework, I'm having a blast learning Elixir with it! I've bumped into a limitation I think: I want to test that a nested router is correctly getting its params from the parent's route_params. An example:
defmodule Users do
  use Maru.Router

  namespace :users do
    route_param :id do
      params do
        require :id, type: Integer
      end

      namespace :posts, do: mount Posts
    end
  end
end

defmodule Posts do
  use Maru.Router

  params do
    # should be coming from the route_param
    require :id, type: Integer
  end

  get do
    # render user's posts
  end
end

In this case I'd get the path /users/:id/posts where the nested router grabs the :id param from the route. However, during unit tests of the Posts route, I've no way (afaik) of testing that it's grabbing the id from the route correctly, since all paths are relative to that router (i.e.: /).
I guess I could test this from the Users router, but that doesn't make a lot of sense since the functionality doesn't really belong to it.
I think we should be able to test this, perhaps with Routing unit tests?

Thanks your feedback ❤
I think it's a bug, I'll fix it soon

I think the new unittest pr also resolved this issue, sorry for the delay.

Yep, that fixed it, thank you :)


iTorch linked to python, not torch

I followed the install instructions for a global install of torch.
My OS is Ubuntu 14.04.
When I run itorch, ipython seems to run python, not torch/lua.
mapeot@mapeot-Precision-WorkStation-T3500:~$ itorch
IPython Console 3.0.0
IPython profile: torch

In [1]: require('torch')

NameError                                 Traceback (most recent call last)
<ipython-input-1-76f35706807b> in <module>()
----> 1 require('torch')

NameError: name 'require' is not defined

In [2]:

i pushed fixes yesterday for this behavior. Have you updated itorch recently? (luarocks install itorch).

I installed itorch yesterday afternoon (perhaps 3:00 pm EDT).
I re-installed itorch at 1:33 pm EDT and the problem persists.
(I did not clean out the old itorch files before re-installing)
I am not an ipython afficiando, so I do not know whether the problem is in ipython or the torch kernel.
Evidence:
$ ipython console --kernel torch    # The kernel doesn't load...
[ZMQTerminalIPythonApp] CRITICAL | Could not find kernel torch
$ ls .ipython                                  # ...but hings kind of look like they are in the right place.
extensions  nbextensions     profile_itorch  README
kernels     profile_default  profile_torch
$ ls .ipython/kernels
itorch
$ ls .ipython/kernels/itorch
kernel.json  logo-64x64.png
$ cat .ipython/kernels/itorch/kernel.json
{
"argv": [
"/usr/local/bin/itorch_launcher",
"{connection_file}"
],
"display_name": "iTorch",
"language": "lua"
}
$ ls /usr/local/bin/itorch*
/usr/local/bin/itorch  /usr/local/bin/itorch_launcher

@markpeot it's possible that because of your global install, you wrote some files as sudo.
Did you install itorch with the command: "sudo luarocks install itorch"?
If you used sudo, then you might also have to run the following command:
sudo chown -R $USER ~/.ipython

That might fix it for you.

@soumith , when I use 'sudo luarocks install itorch', the modificatio of .ipython went into root/.ipython not the user running sudo, is this the expected behavior? archlinux and ipython2

@ddgg i've never actually tested with sudo, this has to be given more thought. We never need sudo because the default torch install is local. Any ideas?

@soumith , maybe this one?
http://stackoverflow.com/questions/3522341/identify-user-in-a-bash-script-called-by-sudo

@soumith, "sudo chown -R $USER ~/.ipython" did not fix the problem.
I am going to try to reinstall everything (python, ipython, torch) from scratch and see whether I can get iTorch to work.

A local install works (i.e. if I reinstall without using "sudo").

I'm having a similar issue.  I did a local install of itorch however when i run itorch notebook I keep getting the message the the itorch kernel is "not found".
If I run the notebook as root then I run into env issues where the environment in the notebook isn't finding the rocks that I've installed locally.  Even if I do:
sudo env "PATH=$PATH" luarocks make
sudo chown -R $USER $(dirname $(ipython locate profile))
Any ideas on how to resolve this one?

So it seems the gist of my problem is if I run as a local user I receive permission errors from the itorch kernel.  when running as root i have issues because of locally installed torch libs that can't be seen by root.  I have so far not had success passing my env along via sudo.

I was having this problem with the qtconsole only.  I found an easy work around:
itorch qtconsole --profile=itorch

same problem here. I tried using itorch notebook --profile=itorch' which does make the "itorch" kernel available as a choice under kernels` in the notebook, but it doesn't seem like the kernel is actually connected, and I can't evaluate anything. Furthermore on the upper right hand side, it just says "kernel" instead of, say "python 2" or "torch"

Thank you for reporting this issue and appreciate your patience. We've  notified the core team for an update on this issue. We're looking for a response within the next 30 days or the issue may be closed.

I am having a similar problem. This is what I get when I run the command:
itorch qtconsole --profile=itorch
[JupyterQtConsoleApp] WARNING | Unrecognized alias: '--profile=itorch', it will probably have no effect.

I solved it~~~ using luarocks install itorch
But at first it comes out some error likes cannot create /home/xxx/.python/xxx
And I run sudo chown -R $USER:$USER /home/**/* to change the owner of there directories, then rerun luarocks install itorch without any error.
After that, there is a itorch choice on the website http://localhost:8888 when I run itorch notebook

Not sure if this is still relevant, but if iTorch was installed by sudoer with sudo luarocks install itorch, and you do not have a local torch installation, you can use this script snippet to install the iTorch profile and kernel in ~/.ipython/
It is not much, I just modified a bit of the script from the .rockspec file, where it tries to find itorch_launcher in your PATH, and inserts in the right place.


Fix bug in template, clashing with pipeline substitutions

the pipeline provides some vars which we replace in code:
"${{package.name}}"
"${{package.version}}"
"${{package.epoch}}"
"${{targets.destdir}}"

Any config file with these is panicking out w/ template bc it doesn't know how to parse them. Unfortunately go templates don't allow ignoring certain values (TIL a proposal was denied https://github.com/golang/go/issues/31147)
There are a couple options:

change the delimiter from {{ }} to [[ ]] so go templates can differentiate.
do an ugly string substitution before applying the go template and then reset it

I started with (1) but figured that would be really inconvenient for users so switched to (2)
Signed-off-by: Priya Wadhwa<EMAIL_ADDRESS>

Yeah, I see what you mean in the nginx build.
I'm not sure what to suggest either. There's probably something to do with quoting, but that might get complex. Using a different delimiter is wise anyway as melange is intended to work well with actions.

Hmm, this is a very GitHub action specific fix. We might want to think about a more general solution?


Weird C++ pointer and variable corruption stuff

In the Mesh and Framebuffer classes is a big problem: parameters of pointers and normal variables passed in as function parameters go corrupt when the function is exited because of local variables or stuff like that.  It was fixed in the framebuffer class with hard coding, but that is just a temporary solution, and everything breaks down in the mesh class

Now a similar issue is also happening in the image class

done


Package rename

Changes Unknown when pulling 2a27b92341ad75548e53951e21e4459381b5f29b on package-rename into ** on develop**.

Changes Unknown when pulling 2a27b92341ad75548e53951e21e4459381b5f29b on package-rename into ** on develop**.

Changes Unknown when pulling 2a27b92341ad75548e53951e21e4459381b5f29b on package-rename into ** on develop**.

Changes Unknown when pulling be5dc4957ecbf35e234e4af99a7053d3e80b62f0 on package-rename into ** on develop**.

Changes Unknown when pulling 03709e7cb00da77bf855013ce9c546317455b655 on package-rename into ** on develop**.

Changes Unknown when pulling 112ea7b7a6577abe48c422f906c3a8900567295e on package-rename into ** on develop**.

Changes Unknown when pulling a4988d6f7634d962a1631b5ba9dd97e7951f8d8e on package-rename into ** on develop**.


copr: Add vectorize FromBase64.

Signed-off-by: pingyu<EMAIL_ADDRESS>PCP #5751
What have you changed?
Add vectorize FromBase64.
What is the type of the changes?

New feature (a change which adds functionality)

How is the PR tested?

Unit test

Does this PR affect documentation (docs) or should it be mentioned in the release notes?
No.
Does this PR affect tidb-ansible?
No.
Refer to a related PR or issue link (optional)
#5751

/run-all-tests

I suggest picking up challenge from #6933 first.


Set up tconnectsync - login issues

Hi, I am helping someone with tconnectsync for the first time, and I am facing some issues.
When running sudo docker run --env-file=.env jwoglom/tconnectsync --check-login,  it seems the .env file is read and it does seem to log into Nightscout, but apart from that it is complaining about credentials. Did I get the wrong credentials from those I am helping, or is there something I am missing? Is there any account activation they would have to do to make this work? I don't have any first hand experience with their t:connect app (iOS). I can get more details later, but this is what I have now.
Setup details

Operating system: Ubuntu 20.04
tconnectsync version (from --version): 0.9.3
On what platform are you using the t:connect mobile app?: iOS
What version are you using of the t:connect mobile app?

I could not locate tconnectsync-check-output.log, but I don't se any sensitive info in the output, so am posting that here:
tconnectsync version 0.9.3
Python version 3.9.16 (main, Feb  4 2023, 03:27:06)
[GCC 10.2.1 20210110]
System platform linux
Running checks with time range 2023-02-12 22:23:19.723088 to 2023-02-13 22:23:19.723088
Current time: 2023-02-13 22:23:19.723710
time.tzname: ('UTC', 'UTC')
Loading secrets...
TIMEZONE_NAME: Europe/Berlin
-----
Logging in to t:connect ControlIQ API...
2023-02-13 22:23:19 INFO     Logging in to ControlIQApi...
2023-02-13 22:23:20 INFO     Reported tconnect software version: t:connect <IP_ADDRESS>
Error occurred querying ControlIQ API for dashboard_summary:
Traceback (most recent call last):
  File "/home/appuser/tconnectsync/check.py", line 85, in check_login
    summary = tconnect.controliq.dashboard_summary(time_start, time_end)
  File "/home/appuser/tconnectsync/api/__init__.py", line 31, in controliq
    self._ciq = ControlIQApi(self.email, self.password)
  File "/home/appuser/tconnectsync/api/controliq.py", line 25, in __init__
    self.login(email, password)
  File "/home/appuser/tconnectsync/api/controliq.py", line 38, in login
    raise ApiLoginException(req.status_code, 'Error logging in to t:connect. Check your login credentials.')
tconnectsync.api.common.ApiLoginException: Error logging in to t:connect. Check your login credentials. (HTTP 200)

Querying ControlIQ therapy_timeline...
2023-02-13 22:23:20 INFO     Logging in to ControlIQApi...
2023-02-13 22:23:21 INFO     Reported tconnect software version: t:connect <IP_ADDRESS>
Error occurred querying ControlIQ therapy_timeline:
Traceback (most recent call last):
  File "/home/appuser/tconnectsync/check.py", line 99, in check_login
    tt = tconnect.controliq.therapy_timeline(time_start, time_end)
  File "/home/appuser/tconnectsync/api/__init__.py", line 31, in controliq
    self._ciq = ControlIQApi(self.email, self.password)
  File "/home/appuser/tconnectsync/api/controliq.py", line 25, in __init__
    self.login(email, password)
  File "/home/appuser/tconnectsync/api/controliq.py", line 38, in login
    raise ApiLoginException(req.status_code, 'Error logging in to t:connect. Check your login credentials.')
tconnectsync.api.common.ApiLoginException: Error logging in to t:connect. Check your login credentials. (HTTP 200)

Querying ControlIQ therapy_events...
2023-02-13 22:23:21 INFO     Logging in to ControlIQApi...
2023-02-13 22:23:21 INFO     Reported tconnect software version: t:connect <IP_ADDRESS>
Error occurred querying ControlIQ therapy_events:
Traceback (most recent call last):
  File "/home/appuser/tconnectsync/check.py", line 115, in check_login
    androidevents = tconnect.controliq.therapy_events(time_start, time_end)
  File "/home/appuser/tconnectsync/api/__init__.py", line 31, in controliq
    self._ciq = ControlIQApi(self.email, self.password)
  File "/home/appuser/tconnectsync/api/controliq.py", line 25, in __init__
    self.login(email, password)
  File "/home/appuser/tconnectsync/api/controliq.py", line 38, in login
    raise ApiLoginException(req.status_code, 'Error logging in to t:connect. Check your login credentials.')
tconnectsync.api.common.ApiLoginException: Error logging in to t:connect. Check your login credentials. (HTTP 200)

-----
Initializing t:connect WS2 API...
2023-02-13 22:23:22 INFO     Logging in to ControlIQApi...
2023-02-13 22:23:22 INFO     Reported tconnect software version: t:connect <IP_ADDRESS>
Error occurred querying WS2 API. This is okay so long as you are not using the PUMP_EVENTS or IOB sync features.
Traceback (most recent call last):
  File "/home/appuser/tconnectsync/check.py", line 127, in check_login
    summary = tconnect.ws2.basaliqtech(time_start, time_end)
  File "/home/appuser/tconnectsync/api/__init__.py", line 43, in ws2
    self.controliq
  File "/home/appuser/tconnectsync/api/__init__.py", line 31, in controliq
    self._ciq = ControlIQApi(self.email, self.password)
  File "/home/appuser/tconnectsync/api/controliq.py", line 25, in __init__
    self.login(email, password)
  File "/home/appuser/tconnectsync/api/controliq.py", line 38, in login
    raise ApiLoginException(req.status_code, 'Error logging in to t:connect. Check your login credentials.')
tconnectsync.api.common.ApiLoginException: Error logging in to t:connect. Check your login credentials. (HTTP 200)

Not able to log in to WS2 API, so skipping therapy_timeline_csv
-----
Logging in to t:connect Android API...
Error occurred querying Android API:
Traceback (most recent call last):
  File "/home/appuser/tconnectsync/check.py", line 156, in check_login
    summary = tconnect.android.user_profile()
  File "/home/appuser/tconnectsync/api/__init__.py", line 55, in android
    self._android = AndroidApi(self.email, self.password)
  File "/home/appuser/tconnectsync/api/android.py", line 44, in __init__
    self.login(email, password)
  File "/home/appuser/tconnectsync/api/android.py", line 65, in login
    raise ApiLoginException(r.status_code, 'Received HTTP %s during login: %s' % (r.status_code, r.text))
tconnectsync.api.common.ApiLoginException: Received HTTP 400 during login: {"statusCode":400,"status":400,"code":400,"message":"Bad Request","name":"invalid_request"} (HTTP 400)

-----
Logging in to Nightscout...
-----
Last basal start time: None (n/a)
Last basal duration: None
Last reading time: None (n/a)
-----
API errors occurred. Please check the errors above.
Created file tconnectsync-check-output.log containing additional debugging information.
For support, you can upload this file to https://github.com/jwoglom/tconnectsync/issues/new
The file -- but NOT the output printed above -- has been sanitized to remove sensitive data.
Please verify and remove any sensitive data, such as your Nightscout URL/secret and pump serial number,
as necessary.

Hey @bjornoleh -- I would try first ensuring they can log in to the t:connect website. I've seen some reports of this before and it typically occurs in users who have never used the online application and have only ever logged in via the mobile app. You might need to reset their password in the app (even if its to the same existing password, if tandem allows). If that still doesn't help, have them go to tconnect.tandemdiabetes.com and follow the "create account" instructions, which will use the desktop t:connect uploader application and should definitely set it up. Otherwise if they still can't log in to the website I'd contact tandem.

I'm having the same issue.  I'm trying to set tconnectsync up on a new laptop.  It worked on the old one (which is at home so I can't easily compare settings or versions, but I suspect that the version of tconnectsync is not as recent).  I can log into both the t:connect website and app just fine, and just confirmed the password.  Any other suggestions?

@clegoues any chance that your password has special characters in it? You might be specifying it as an environment variable or in the .env file improperly. I've added some additional logging to show when tconnectsync falls back on the default credentials (which won't work)


Update storage-auth-aad-app.md

Add comma in end ClientSecret property

@llauderesv : Thanks for your contribution! The author(s) have been notified to review your proposed change.

@llauderesv - Thank you for making that fix!
#sign-off


Help with device

Hi I need a bit of help with a new thermostat device. I cannot get any dps data from it as it seems to not have an ip address according to the debug info
DEBUG:socket unable to connect - retry 1/5
DEBUG:socket unable to connect - retry 2/5
DEBUG:socket unable to connect - retry 3/5
DEBUG:socket unable to connect - retry 4/5
DEBUG:socket unable to connect - retry 5/5
DEBUG:ERROR Network Error: Device Unreachable - 905 - payload: null

or
Status {'Error': 'Network Error: Device Unreachable', 'Err': '905', 'Payload': None}
I've tried with device22 option.
I think this device is faulty as even the smart life app cannot do a "check device network"
I can see its mac address  on smart life app and have found it on my router.
the 'tuya-raw.json' file reports data like ...
 "model": "RSH-TH03",
            "name": "Thermostat",
            "online": true,
            "owner_id": "secret",
            "product_id": "secret",
            "product_name": "\secret",
            "status": [
                {
                    "code": "va_temperature",
                    "value": 203
                },
                {
                    "code": "va_humidity",
                    "value": 49
                },
                {
                    "code": "battery_percentage",
                    "value": 100
                }

Any ways as always I look forward to fixing it :-)
P.s
Happy holidays @jasonacox

Hi @Electrik-rich546456 !  Happy Holidays to you too... I have enjoyed some time off which has afforded me some time to invest in TinyTuya.  I added more TuyaCloud API functions which may actually help.  It won't find the local IP but it will help us discover the DPS ID numbers that you can use to control the device.
import tinytuya

# Turn on Debug Mode (optional)
# tinytuya.set_debug(True)

# Connect to Tuya Cloud
# c = tinytuya.Cloud() # This will use the tinytuya.json file created by the wizard or you can specify:
c = tinytuya.Cloud(
        apiRegion="us",
        apiKey="xxxxxxxxxxxxxxxxxxxx",
        apiSecret="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
        apiDeviceID="xxxxxxxxxxxxxxxxxxID")

# Display list of devices
devices = c.getdevices()
print("Device List: %r" % devices)

# Select a Device ID to Test
id = "xxxxxxxxxxxxxxxxxxID"

# Display Properties of Device
result = c.getproperties(id)
print("Properties of device:\n", result)

# Display Functions of Device
result = c.getfunctions(id)
print("Functions of device:\n", result)

# Display DPS IDs of Device
result = c.getdps(id)
print("DPS IDs of device:\n", result)

# Display Status of Device
result = c.getstatus(id)
print("Status of device:\n", result)

# Send Command - This example assumes a basic switch
commands = {
	'commands': [{
		'code': 'switch_1',
		'value': True
	}, {
		'code': 'countdown_1',
		'value': 0
	}]
}
print("Sending command...")
result = c.sendcommand(id,commands)
print("Results:\n", result)

Hi there I tried the code using c = tinytuya.Cloud()  on ln 9 but got this error.
Traceback (most recent call last):
  File "./thermostat.py", line 9, in <module>
    c = tinytuya.Cloud() # This will use the tinytuya.json file created by the wizard or you can specify:
AttributeError: module 'tinytuya' has no attribute 'Cloud'

Oh dear my bad how is the pip3 install version different to the github version ? When does it get updated ?

This is the output of my thermostat.
Properties of device:
 {'result': {'category': 'wsdcg', 'status': [{'code': 'va_temperature', 'name': '当前温度', 'type': 'Integer', 'values': '{"unit":"℃","min":-200,"max":600,"scale":1,"step":1}'}, {'code': 'va_humidity', 'name': '湿度数值', 'type': 'Integer', 'values': '{"unit":"%","min":0,"max":100,"scale":0,"step":1}'}, {'code': 'battery_percentage', 'name': '电池电量', 'type': 'Integer', 'values': '{"unit":"%","min":0,"max":100,"scale":0,"step":1}'}]}, 'success': True, 't':<PHONE_NUMBER>201}
Functions of device:
 {'result': {'category': 'wsdcg', 'functions': []}, 'success': True, 't':<PHONE_NUMBER>334}
DPS IDs of device:
 {'result': {'category': 'wsdcg', 'functions': [], 'status': [{'code': 'va_temperature', 'dp_id': 1, 'type': 'Integer', 'values': '{"unit":"℃","min":-200,"max":600,"scale":1,"step":1}'}, {'code': 'va_humidity', 'dp_id': 2, 'type': 'Integer', 'values': '{"unit":"%","min":0,"max":100,"scale":0,"step":1}'}, {'code': 'battery_percentage', 'dp_id': 4, 'type': 'Integer', 'values': '{"unit":"%","min":0,"max":100,"scale":0,"step":1}'}]}, 'success': True, 't':<PHONE_NUMBER>466}
Status of device:
 {'result': [{'code': 'va_temperature', 'value': 231}, {'code': 'va_humidity', 'value': 56}, {'code': 'battery_percentage', 'value': 100}], 'success': True, 't':<PHONE_NUMBER>649}

How do just get the temperature as a human readable data (eg 22 `C ) ?
Also seeing as we are getting the info via the tuya api,
Can we make the api request data from device?
It has one button on it that seems to have two functions short press makes the thing update the api with current values. Long press resets it so the smartlife app needs to re find it.
I got myself this unit as I thought it would let me get data from it via serial but all i got was "S2" and S3" as an output, tried lots of different ways of connecting to it to the extent I thought I had broken it at one point but its still working It doesn't seem to want to update itself when i start the smart life app so was thinking of flashing something else like 'tasmota' but have no idea as cant find any data about the hardware and also wanted to find a way to take a backup of existing firmware just in case i broke it but have not had any success.

Hi @Electrik-rich546456, you are right, pip updates can take a while.  I find python3 -m pip install --upgrade tinytuya works best to pull latest but technically pip3 should do the same.
Human Readable Data?
Here is what you would do to process the data into a human readable form (based on the units and scale listed in your output):
# Grab Status of Device
response = c.getstatus(id)

# Parse Response
status = {}
for item in response['result']:
    status[item['code']] = item['value']

# Print Values
print("Temperature = %0.2f °C" % (status['va_temperature']/10))
print("Humidity = %d %%" % status['va_humidity'])
print("Battery = %d %%" % status['battery_percentage'])

Force Update via API?
The function list that you pulled back from TuyaCloud indicates that it doesn't have any command functions we can call to update it:
{'result': {'category': 'wsdcg', 'functions': []}, 'success': True, 't':<PHONE_NUMBER>334}

Where is what I believe is happening:  Most battery powered Tuya devices do not stay online.  They open "wake up" every so often, connect to the WiFi and update the TuyaCloud with their data.  Your "button press" probably forces this.  This is also why you do not see the device on the network when you do a python3 -m tinytuya scan to find it or when you try to connect to it directly using an IP address.  It is asleep most of the time so that it saves the battery life.  If you managed to force it to stay online, it would likely drain the battery in a matter of hours.  Your best path would be to use the above method to get the data that the device delivers to the cloud.
Flash Device to Tasmota?
That's an interesting option.  I have never done this with any device, but I suspect it will be much harder to do with a battery powered device for the reasons I stated above.  If you do manage to get to work, you will want an external power source for it or you will drain the batteries quickly.

Happy new year @jasonacox in advance :-)
I made these changes to your original code

#!/usr/bin/env python3
import time

import tinytuya

# Turn on Debug Mode (optional)
# tinytuya.set_debug(True)

# Connect to Tuya Cloud
c = tinytuya.Cloud() # This will use the tinytuya.json file created by the wizard or you can specify:

# Display list of devices
#devices = c.getdevices()
#print("Device List: %r" % devices)

# Select a Device ID to Test
id = "bf2c558dce75d7c817yz9y"

## Display Properties of Device
#result = c.getproperties(id)
#print("Properties of device:\n", result)
#
## Display Functions of Device
#result = c.getfunctions(id)
#print("Functions of device:\n", result)

# Display DPS IDs of Device
#result = c.getdps(id)
#
#print("DPS IDs of device:\n", result)
#i = 1
while True:

    # Display Status of Device
    result = c.getstatus(id)
    #print(result["result"])
    for item in result["result"]:
    #    print(item)
        if item["code"] == 'va_temperature':
            #unit = (item['value']/10)
            unit = (str(item['value']))
            print("tempature" , unit)
            if unit >= '200':
                print("hot")
            elif unit <= '190':
                print("cold")
    time.sleep(120)
#    i += 1

it works nicely my output is this so i thought but then it did this error

tempature 208
hot
tempature 203
hot
tempature 203
hot
tempature 203
hot
tempature 203
hot
tempature 203
hot
tempature 203
hot
tempature 203
hot
tempature 203
hot
tempature 198
tempature 198
tempature 198
Traceback (most recent call last):
  File "./thermostat.py", line 42, in <module>
    for item in result["result"]:
KeyError: 'result'

I wonder how i can add your suggestion into my code ? But it may be updating enough in the loop but I think the error i got  was due to the api kicking me off.
I was also looking at different ttinyuya functions that could possibly be of use like
tinytuya.HEART_BEAT or tinytuya.UPDATEDPS
what do they do can they help ? :-)

The example code I gave doesn't have any error handling.  Can you add this and try again?
tinytuya.set_debug(True)

Without seeing the debug info, I don't know what the Cloud API sent back, but there is the possibility that it will sometimes deliver a bad response (the devices do this too) or it may indicate that the token has expired.  You can also add some basic error handling:
while True:
    try:
        result = c.getstatus(id)
        if "result" in result:
            for item in result["result"]:
                if item["code"] == 'va_temperature':
                    unit = (item['value']/10)  # tuya stores temps as an integer (10x the real value)
                    print("temperature: %0.1f" % unit)
                    if unit >= 20.0:
                        print("hot")
                    elif unit <= 19.0:
                        print("cold")
    except:
        print("error - ignoring")

    time.sleep(120)

The tinytuya.HEART_BEAT and tinytuya.UPDATEDPS commands are for local control (you would need the device to be on WiFi and pingable on your local network).  Even if it was available via the Cloud API, your device would need to stay on your WiFi full time which would drain the battery in less than a day which is usually the reason it disconnects and only updates the cloud periodically.

Happy new year !!:-)@
I've updated the code and it seems to be running nicely.
How do add the snapshot name function so cant useturn_on() device name

Happy new year !!:-)@
I've updated the code and it seems to be running nicely.
How do add the snapshot name function so cant useturn_on() device name

Do you know what IP address it uses when it comes online to send the update?  If so, set up a constant ping and see how often it responds.  If you don't have the IP, you can look at your router (if it has the ability to show DHCP assignments) or you could run python3 -m tinytuya scan and push the button to see if it reports in. ;)
Happy 2022!! :)

Do you know what IP address it uses when it comes online to send the update?  If so, set up a constant ping and see how often it responds.  If you don't have the IP, you can look at your router (if it has the ability to show DHCP assignments) or you could run python3 -m tinytuya scan and push the button to see if it reports in. ;)
Happy 2022!! :)

Hi, Yes I found the IP address by cross referencing with the mac address found on smartlife app.
I made this to time when its online.
#!/usr/bin/env python3
import datetime
import time

import os
hostname = "<IP_ADDRESS>" #example
#response = os.system("arping -c 1 " + hostname)

while True:
    exit_code = os.system(f"arping -c 1 {hostname} > /dev/null 2>&1")
    if exit_code == 0:
        print(datetime.datetime.now().time(), hostname, exit_code == 0)
    elif exit_code == 1:
        print("down")
    time.sleep(1)

But its very strange as the output is this ....
19:27:17.867410 <IP_ADDRESS> True
19:27:19.895136 <IP_ADDRESS> True

	19:27:21.915193 <IP_ADDRESS> True
	21:33:04.763419 <IP_ADDRESS> True  2 hours, 5 minutes, and 43 seconds

  21:33:08.795348 <IP_ADDRESS> True
  22:14:35.379331 <IP_ADDRESS> True  0 hour, 41 minutes, and 27 seconds

22:14:37.399439 <IP_ADDRESS> True
22:14:39.419444 <IP_ADDRESS> True
22:15:46.087434 <IP_ADDRESS> True
22:15:48.107233 <IP_ADDRESS> True
22:15:50.127444 <IP_ADDRESS> True
22:16:54.759447 <IP_ADDRESS> True
22:16:56.779370 <IP_ADDRESS> True
22:16:58.795390 <IP_ADDRESS> True
22:19:14.079294 <IP_ADDRESS> True
22:19:16.099459 <IP_ADDRESS> True
22:19:18.119388 <IP_ADDRESS> True
22:21:33.459374 <IP_ADDRESS> True
22:21:35.479396 <IP_ADDRESS> True
22:21:37.499417 <IP_ADDRESS> True
22:25:03.527448 <IP_ADDRESS> True
22:25:05.547350 <IP_ADDRESS> True
22:25:07.567417 <IP_ADDRESS> True
22:29:46.295447 <IP_ADDRESS> True
22:29:48.315304 <IP_ADDRESS> True
22:29:50.335316 <IP_ADDRESS> True
22:33:16.375462 <IP_ADDRESS> True
22:33:18.395445 <IP_ADDRESS> True
22:33:20.415362 <IP_ADDRESS> True
22:35:37.747437 <IP_ADDRESS> True
22:35:39.767455 <IP_ADDRESS> True
22:35:41.791218 <IP_ADDRESS> True
22:37:57.115403 <IP_ADDRESS> True
22:37:59.135440 <IP_ADDRESS> True
22:38:01.151363 <IP_ADDRESS> True
22:41:27.223154 <IP_ADDRESS> True
22:41:29.243426 <IP_ADDRESS> True
22:41:31.263356 <IP_ADDRESS> True
22:47:16.663211 <IP_ADDRESS> True
22:47:18.683364 <IP_ADDRESS> True
22:47:20.703401 <IP_ADDRESS> True
22:55:23.507419 <IP_ADDRESS> True
22:55:25.519464 <IP_ADDRESS> True
22:55:27.535433 <IP_ADDRESS> True
00:02:28.211286 <IP_ADDRESS> True
**00:02:30.235454 <IP_ADDRESS> True It just stopped after that point**

I'm not sure why at 10pm ish it starts to be so active unless it comes online every time a change is detected by the thermostat. What do you think?
Happy 2022!! :)

I made these changes I'm going to leave it running over night to see the results.
Unless you have any improvements in mined?
#!/usr/bin/env python3
import time
import datetime
import os
import tinytuya
# Turn on Debug Mode (optional)
tinytuya.set_debug(True)
# Connect to Tuya Cloud
c = tinytuya.Cloud()
# Select a Device ID to Test
id = "bf2c558dce75d7c817yz9y"
counter = 0
def checker():
    global counter
    try:
        result = c.getstatus(id)
        if "result" in result:
            for item in result["result"]:
                if item["code"] == 'va_temperature':
                    unit = (item['value']/10)  # tuya stores temps as an integer (10x the real value)
                    print("temperature: %0.1f" % unit)
                    if unit >= 22.0:
                        print("hot")
                    elif unit <= 19.5:
                        print("cold")
    except:
        print("error - ignoring")

#    time.sleep(120)
    counter += 1

hostname = "<IP_ADDRESS>" #example
#response = os.system("arping -c 1 " + hostname)

while True:
    exit_code = os.system(f"arping -c 1 {hostname} > /dev/null 2>&1")
    if exit_code == 0:
        if counter == 0:
            print(datetime.datetime.now().time(), hostname, exit_code == 0)
            checker()
        else:
            counter = 0

    time.sleep(1)

Looks good!  It will be interesting to see what happens.  I suspect it is sending updates when the temperature values change (at least some %).

This is the output :-(
DEBUG:TinyTuya [1.3.0]

DEBUG:Starting new HTTPS connection (1): openapi.tuyaeu.com:443
DEBUG:https://openapi.tuyaeu.com:443 "GET /v1.0/token?grant_type=1 HTTP/1.1" 200 194
01:21:25.927217 <IP_ADDRESS> True
DEBUG:Starting new HTTPS connection (1): openapi.tuyaeu.com:443
DEBUG:https://openapi.tuyaeu.com:443 "GET /v1.0/iot-03/devices/bf2c558dce75d7c817yz9y/status HTTP/1.1" 200 159
temperature: 23.0
hot
01:21:30.195091 <IP_ADDRESS> True
DEBUG:Starting new HTTPS connection (1): openapi.tuyaeu.com:443
DEBUG:https://openapi.tuyaeu.com:443 "GET /v1.0/iot-03/devices/bf2c558dce75d7c817yz9y/status HTTP/1.1" 200 159
temperature: 22.5
hot
01:28:24.551356 <IP_ADDRESS> True
DEBUG:Starting new HTTPS connection (1): openapi.tuyaeu.com:443
DEBUG:https://openapi.tuyaeu.com:443 "GET /v1.0/iot-03/devices/bf2c558dce75d7c817yz9y/status HTTP/1.1" 200 159
temperature: 22.0
hot
01:37:34.083147 <IP_ADDRESS> True
DEBUG:Starting new HTTPS connection (1): openapi.tuyaeu.com:443
DEBUG:https://openapi.tuyaeu.com:443 "GET /v1.0/iot-03/devices/bf2c558dce75d7c817yz9y/status HTTP/1.1" 200 159
temperature: 22.0
hot
01:37:38.339391 <IP_ADDRESS> True
DEBUG:Starting new HTTPS connection (1): openapi.tuyaeu.com:443
DEBUG:https://openapi.tuyaeu.com:443 "GET /v1.0/iot-03/devices/bf2c558dce75d7c817yz9y/status HTTP/1.1" 200 159
temperature: 21.5
01:52:35.103191 <IP_ADDRESS> True
DEBUG:Starting new HTTPS connection (1): openapi.tuyaeu.com:443
DEBUG:https://openapi.tuyaeu.com:443 "GET /v1.0/iot-03/devices/bf2c558dce75d7c817yz9y/status HTTP/1.1" 200 159
temperature: 21.0
03:10:19.095384 <IP_ADDRESS> True
DEBUG:Starting new HTTPS connection (1): openapi.tuyaeu.com:443
DEBUG:https://openapi.tuyaeu.com:443 "GET /v1.0/iot-03/devices/bf2c558dce75d7c817yz9y/status HTTP/1.1" 200 69
DEBUG:Error from Tuya Cloud: 'token invalid'
03:10:23.299353 <IP_ADDRESS> True
DEBUG:Starting new HTTPS connection (1): openapi.tuyaeu.com:443
DEBUG:https://openapi.tuyaeu.com:443 "GET /v1.0/iot-03/devices/bf2c558dce75d7c817yz9y/status HTTP/1.1" 200 69
DEBUG:Error from Tuya Cloud: 'token invalid'
04:35:56.711424 <IP_ADDRESS> True
DEBUG:Starting new HTTPS connection (1): openapi.tuyaeu.com:443
DEBUG:https://openapi.tuyaeu.com:443 "GET /v1.0/iot-03/devices/bf2c558dce75d7c817yz9y/status HTTP/1.1" 200 69
DEBUG:Error from Tuya Cloud: 'token invalid'
09:07:12.455435 <IP_ADDRESS> True
DEBUG:Starting new HTTPS connection (1): openapi.tuyaeu.com:443
DEBUG:https://openapi.tuyaeu.com:443 "GET /v1.0/iot-03/devices/bf2c558dce75d7c817yz9y/status HTTP/1.1" 200 69
DEBUG:Error from Tuya Cloud: 'token invalid'

Why is my token invalid, its fine if i start the script again?

The token expired.  I need to add some code into the library to detect that and refresh the token.  Good catch.

I just published v1.3.1 - see if this works.  I don't how long the tokens last so I created an test by artificially changing the token to get the 'invalid token' error from Tuya.  Hopefully this will capture the real expiration as well.
Thanks for helping test these new cloud functions.
python3 -m pip install --upgrade tinytuya

Would putting something like except "token invalid" in my checker function be any good ?

Also would putting c = tinytuya.Cloud() and id=blahhhhh into the checker function be any good? So it wold be restarting every time that function is run ?

Yes, you could but I added code to the library to re-authenticate with TuyaCloud when the token dies. Woud you be able to test it for me?
python3 -m pip install --upgrade tinytuya

After upgrading to v 1.3.1, re-run your script to see if that fixes the issue.

This is great!  There are 3 examples of the token expiring and tinytuya renewing it.  Thanks for testing!  Let me know if you see anything wrong.
DEBUG:Token Expired - Try to renew
DEBUG:Starting new HTTPS connection (1): openapi.tuyaeu.com:443
DEBUG:https://openapi.tuyaeu.com:443 "GET /v1.0/token?grant_type=1 HTTP/1.1" 200 194
DEBUG:GET: response code=200 text={"result":{"access_token":"07b88c1783e4e7146ff099d307b79ea0","expire_time":7200,"refresh_token":"1becd3be95aafc0131ad11d3f381024b","uid":"bay1589200703093rRcs"},"success":true,"t":1641208310087} token=None
DEBUG:Starting new HTTPS connection (1): openapi.tuyaeu.com:443
DEBUG:https://openapi.tuyaeu.com:443 "GET /v1.0/iot-03/devices/bf2c558dce75d7c817yz9y/status HTTP/1.1" 200 159
DEBUG:GET: response code=200 text={"result":[{"code":"va_temperature","value":186},{"code":"va_humidity","value":57},{"code":"battery_percentage","value":100}],"success":true,"t":1641208310276} token=07b88c1783e4e7146ff099d307b79ea0
temperature: 18.6
cold

I know its cool its working ! You are welcome I enjoyed testing.
Got a few questions, Is the "expire_time":7200" the max time allowed by the api?
How do I pull in the use of a wifi plug by name to use instead of the print cold or hot statements??
eg d.turn_on("radiator")

Good questions.  The "expire_time" value is set by the TuyaCloud (that is the response).  In your example, that seems to hold true as it requires a new token every 2 hours.  Tuya is setting that value so it likely isn't adjustable, but with the token renewal logic, it shouldn't matter.
If you want to take local action on your Tuya devices, you just add the OutletDevice code:
# At the start of your code
radiator = tinytuya.OutletDevice(DEVICEID, DEVICEIP, DEVICEKEY)
d.set_version(3.3)

# Add to section where you want to turn on/off
radiator.turn_off()
radiator.turn_on()

Can't I use Device ID  of the plug to turn on and off?

I think I misunderstood your request.  If you want to turn it off via the Cloud API, you will need to do something like this instead:
# Send Command - Turn on switch
commands = {
	'commands': [{
		'code': 'switch_1',
		'value': True
	}, {
		'code': 'countdown_1',
		'value': 0
	}]
}
print("Sending turn on command...")
c.sendcommand(DeviceID,commands)

Hi hows it going ?
I may have discovered another error...
If i run this on my pc its fine if i run it on the pi it fails with
TinyTuya [1.3.1]

GET: response code=200 text={"result":{"access_token":"xxxxxxxx","expire_time":4739,"refresh_token":"xxxxx","uid":"xxxxx"},"success":true,"t":1641383117344} token=None
11:45:16 AM Host is online
GET: response code=200 text={"result":[{"code":"va_temperature","value":224},{"code":"va_humidity","value":42},{"code":"battery_percentage","value":97}],"success":true,"t":1641383148528} token=xxxxxx
temperature: 22.4
status() entry (dev_type is device22)
building payload=b'{"devId":"xxxxxx","uid":"xxxxx","t":"1641383148","dps":{"1":null}}'
payload generated=b'\x00\x00U\xaa\x00\x00\x00\x00\x00\x00\x00\r\x00\x00\x00\x873.3\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xd9 b\\\xdei\xa9&\x12\xc8\xe6\xaf\xf8<=\x9d\x04jy]\xdf\xe3D\xb1\x1bDQ\x1e:\x02"\xad\xfdx\\-\x9f\x0f&\x02\xe25\xd9\x89y\x19\x9c\xf1G\xd8\xe2i\xc31L>>\x9d:\xeb!\x07\xf1\xfe>\x92p\xda\xea-\'\xfdBag7\x945\xad\x86+\xe3\r\xcc\xf0(\xab1\x94\x10\x94\xd0\xe9\xd9?\xe3\xba\x1d\xa6\xee\x00\xe8\xc5\xfbd\x1ak\x93\xc2\x94\xf4\xeb\xb9\x99\xae"\x00\x00\xaaU'
socket unable to connect - retry 1/5
socket unable to connect - retry 2/5
socket unable to connect - retry 3/5
socket unable to connect - retry 4/5
socket unable to connect - retry 5/5

`ERROR Network Error: Device Unreachable - 905 - payload: null
status() received data={'Error': 'Network Error: Device Unreachable', 'Err': '905', 'Payload': None}
'dps'

My code that running
#!/usr/bin/env python3
import time
import os
import json
import logging

import tinytuya

# Get the top-level logger object
log = logging.getLogger()

# make it print to the console.
console = logging.StreamHandler()
log.addHandler(console)

t = time.localtime()

with open('/home/pi/bin/phplights/snapshot.json') as json_file:
    jdata = json.load(json_file)

# Turn on Debug Mode (optional)
tinytuya.set_debug(True)
# Connect to Tuya Cloud
c = tinytuya.Cloud() # This will use the tinytuya.json file created by the wizard or you can specify:
# Select a Device ID to Test
id = "xxxx"
counter = 0

def pfow(name, *num):
    for item in jdata["devices"]:
        if item["name"] == name:
            break
    d = tinytuya.OutletDevice(item["id"], item["ip"], item["key"], 'device22')
    d.set_version(float(item["ver"]))
    d.set_dpsUsed({"1": None})
    data = d.status()
    for n in num:
        if n == 1:
            if(data['dps']['1'] == True):
                log.warning("Radiator is on Turning off")
                d.turn_off()
        if n ==2:
            if(data['dps']['1'] == False):
                log.warning("Radiator is off Turing on")
                d.turn_on()

def checker():
    global counter
    try:
        result = c.getstatus(id)
        if "result" in result:
            for item in result["result"]:
                if item["code"] == 'va_temperature':
                    unit = (item['value']/10)  # tuya stores temps as an integer (10x the real value)
                    log.warning("temperature: %0.1f" % unit)
                    if unit >= 22.0:
                        #log.warning("hot")
                        pfow("Bedroom Radiator",  1)
                    elif unit <= 19.5:
                        pfow("Bedroom Radiator",  2)
                        #log.warning("cold")
    except(RuntimeError, TypeError, NameError, Exception) as e:
        log.warning(f'{e}')

#    time.sleep(120)
    counter += 1

hostname = "<IP_ADDRESS>" #example
#response = os.system("arping -c 1 " + hostname)

while True:
    ret = os.system(f"ping -c 1 {hostname} > /dev/null 2>&1")
    if ret == 0:
        if counter == 0:
            current_time = time.strftime("%r", t)
            log.warning(f'{current_time} Host is online')
#            log.warning(datetime.datetime.now().time())
#            log.warning("Host is online")
            #print(datetime.datetime.now().time(), hostname, exit_code == 0)
            checker()
        else:
            counter = 0

    time.sleep(1)

Are you able to ping the device from the PI?  The error indicates it is not reachable from the PI:
ERROR Network Error: Device Unreachable - 905

Well no it seems to be pot pingable but if i change to tinytuya.BulbDevice instead of tinytuya.OutletDevice it works !!
What's the difference ?

BulbDevice class is similar to OutletDevice (both use the root Device class) but adds bulb attributes (type, brightness, color) and related functions for controlling smart bulbs.  I don't know how it would make a difference in you case.  Very interesting.

Hi i think it was just a strange ghost in the code... as it stopped working due to the it not having an ip address anymore so i just used the new cloud function instead.
I just need your help with two more things.
1 how do i make the output from print("DPS IDs of device:\n", result) more human readable ?
2 how to I make an if statement to check power status ? using the cloud function

Hi @jasonacox I seem to have a new problem..
This is my error im getting
TypeError: __init__() should return None, not 'dict'
but only if the script is running as www-data (33) user.
If I switch to that user in the terminal it works and doesn't give any errors
same if i run as standard user.
Do you know how to make the script use all imported modules like soket and the like ?

I must be missing some context.  Are you running the script from a web server?

Hi @jasonacox Yeah it's running on my RPI 2b along side pi.hole.
I've created a PHP page with a load of buttons on it each one runs a little
Py script when clicked. They all work except the one using the new
tuya.cloud function.
I suspect it's some strange path of modules thing. 😞
On Thu, 20 Jan 2022, 2:30 am Jason Cox, @.***> wrote:

I must be missing some context. Are you running the script from a web
server?
—
Reply to this email directly, view it on GitHub
https://github.com/jasonacox/tinytuya/issues/94#issuecomment-1017059003,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AN3GUW4SWVHZDASWKSQX7MDUW5XTFANCNFSM5KVX2BCA
.
Triage notifications on the go with GitHub Mobile for iOS
https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675
or Android
https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
You are receiving this because you were mentioned.Message ID:
@.***>

Ah, I see.  If you are using this line:  c = tinytuya.Cloud() in your code, that by default will try to load a local tinytuya.json file.  PHP not like that or have a pwd available to use.  You could fix that specifying the credentials as parameters:
# c = tinytuya.Cloud()  # uses tinytuya.json
c = tinytuya.Cloud(
        apiRegion="us",
        apiKey="xxxxxxxxxxxxxxxxxxxx",
        apiSecret="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
        apiDeviceID="xxxxxxxxxxxxxxxxxxID")


[JENKINS-45980] Adds password parameter to Job DSL

See associated feature request.
Exactly as the ticket says, the password parameter is built into Jenkins/Hudson by default so why not have it as a default option in the DSL?

It seems the CI runner is hanging? Seemed to do so locally as well.

See JENKINS-18141.

@daspilker I'm wondering if JENKINS-18141 you linked is relevant anymore.  I do not see any password parameter option on latest Jenkins via the Automatic DSL, and mask-password plugin is outdated/unsupported and currently has vulnerabilities.  What is the current way of producing the same parameter as a pipeline using password() in parameters closure?

any updates on this?

any updates on adding the passwordParam(), still i dont see it in the latest DSL.

I think it might be kind of workaround guys:
password {                         name('SVC_PASSWORD')                         description('Enter a password for given SVC.')                         defaultValueAsSecret(Secret.fromString('SECRET'))                     }


Stuck in Windows 10 Login Screen, after first Update

Aloha,
as mentioned in the title, after using "IoT-LTSC-Like" autounattend.xml file and installing windows 10, everything seems fine. Adjusted OS personal settings, connecting my Microsoft Account, prepared the rest of my drives and searching for new Updates (to get every driver for my hardware).
(Note, so just Windows stuff no new software installed)
But after the installation prompt asked me to restart, and the restart, I am stuck at the login screen without a password prompt. Common solutions (like CTRL + SHFT + DEL) won't work. Did every debug step twice, even re-configuarting the installation USB-Drive.
What did I miss?

Hi, this really shouldn't be happening and I'm not sure why it is happening. Have you tried booting from the Installation USB again, then clicking on "Repair your computer" to access the recovery settings and then uninstalling the updates, just to test?


[WIP] Add a build in CI for spark 3.0.0.rc (waiting for pypi release)

The pypi package is not released yet. Once it is available, I'll update the code.

@liangz1
I build latest master pyspark and upload to S3.
Use pip install pip install https://ml-team-public-read.s3-us-west-2.amazonaws.com/pyspark-3.1.0.dev0-60dd1a690fed62b1d6442cdc8cf3f89ef4304d5a.tar.gz to install latest spark.

Summary:

This PR add latest spark master version test in CI.
Fix dict_to_spark_row method, See https://github.com/uber/petastorm/pull/521#discussion_r400610879
For spark<3.0 and pyarrow>=0.15, add ARROW_PRE_0_15_IPC_FORMAT=1 in CI, and remove unnecessary skipif in test. See explanation in https://spark.apache.org/docs/3.0.0-preview/sql-pyspark-pandas-with-arrow.html#compatibiliy-setting-for-pyarrow--0150-and-spark-23x-24x


fix: speed up rendering product list

This is down from ~15s to ~2s … not perfect, but a big improvement


Refactor gradient_check.check_backward

In the current implementation of  gradient_check.check_backward, computation of backward gradients / numerical gradients / some checks are mixed and very difficult to understand.
I refactored the function for readability and maintainability.

I want to make it explicit that _directional_backward_gradients is used to update y_grad, so I made it return y_grad instead of updating.
Do you think its ok?

Fixed so that the forward pass is done before direction sampling.
PTAL

This PR is intended to keep the semantics.
All the difference I found is that the new _directional_numeric_gradients don't reuse input Variables.  The change is OK because:

It's necessary for _directional_numeric_gradients to be clean;
Before the PR, func to be checked should not use x.grad.  I don't come up with a case func uses x.grad.

Jenkins, test this please.


Double Fetch Metadata Request Headers reference

Fetch has both [WEBAPPSEC-FETCH-METADATA-1] and [FETCH-METADATA]. The former does not exist per https://www.specref.org/?q=WEBAPPSEC-FETCH-METADATA-1 and is also not mentioned in Fetch directly. I guess it got in there through Shepherd perhaps?
cc @plinss

Shepherd does have webappsec-fetch-metadata-1 (I'm guessing @tabatkins added it?)
I can rename it to fetch-metadata, but will that break references elsewhere?

I don't think anything but Fetch references it. @mikewest would probably know.

Fetch doesn't have this problem anymore, and I suspect #1761 will fix it more generally.


Final event before lambda shut down is not sent

My code kinda looks like this
def before_send(event, hint):
    log.info("Before Sending the Event, {} and Hint : {}".format(repr(event), repr(hint)))
    return event

sentry_sdk.init(integrations=[AwsLambdaIntegration()], debug=True, before_send=before_send)

def get_terrain_async(event, context):
    # THIS IS SENT TO SENTRY
    capture_exception(Exception("SEND ME AND EXCEPTION"))
    log.info("event: {}".format(json.dumps(event)))
    try:
        generate()

        return {
            "statusCode": 204,
            "body": "{}",
            "headers": {"Access-Control-Allow-Origin": "*", "Content-Type": "application/json"},
        }

    except Exception as e:
        # THIS IS NEVER SENT
        capture_exception(e)
        return return_error(e, order_id)

def return_error(e, order_id):
    log.error(repr(e))
    return {
        "statusCode": 500,
        "body": json.dumps({"error": repr(e)}),
        "headers": {"Access-Control-Allow-Origin": "*", "Content-Type": "application/json"},
    }

And I can see in my log that before_send event is called for the last event but never ends up in my sentry events.
Is there something about the lambda being killed before the event is passed to sentry?

Yes and that is what the aws lambda integration is supposed to prevent though. Could you tell me which python version this is on AWS?

Sorry for late answer, I am using python3.7 with sentry-sdk==0.13.2

@SimonsUnikaNamn could you try bumping the shutdown_timeout parameter to a higher number than 2?
init(shutdown_timeout=20)

Thank you, that worked! :)


[Feature] Get the row and column of the cells directly under the mouse based on the coordinates on the screen where the current mouse is located

Initial checklist

[X] Is this really a problem?
[X] I have searched the Github Issues for similar issues, but did not find anything.

Problem
I hope to be able to set the corresponding selection based on the currently obtained rows and columns directly below the mouse, plus my own calculations. It may be multiple rows and columns, following the movement of the mouse.
Solution
step 1: Get the row and column of the cells directly under the mouse based on the coordinates on the screen where the current mouse is located.
step2: Calculate the selection range based on the cell row and column information obtained in the first step, and set the selection range to be displayed in the sheet.

Pay attention to the next version of Facade update. After getting the cell information through onCellPointerMove, you can perform customized operations.
univerAPI.getSheetHooks().onCellPointerMove((cell) => {
  // Get the cell currently pointed by the mouse
  console.log(cell);
})


Sync: Add DiskRP 09-30 and CloudServices preview release

Make compute-2020-12 release a preview release.
Add new DiskRP release
Add new CloudServices release.

MSFT employees can try out our new experience at OpenAPI Hub  - one location for using our validation tools and finding your workflow.

Changelog
Please ensure to add changelog with this PR by answering the following questions.

What's the purpose of the update?

[ ] new service onboarding
[ ] new API version
[ ] update existing version for new feature
[ ] update existing version to fix swagger quality issue in s360
[ ] Other, please clarify

When you are targeting to deploy new service/feature to public regions? Please provide date, or month to public if date is not available yet.
When you expect to publish swagger? Please provide date, or month to public if date is not available yet.
If it's an update to existing version,  please select SDKs of specific language and CLIs that require refresh after swagger is published.

[ ] SDK of .NET (need service team to ensure code readiness)
[ ] SDK of Python
[ ] SDK of Java
[ ] SDK of Js
[ ] SDK of Go
[ ] PowerShell
[ ] CLI
[ ] Terraform
[ ] No, no need to refresh for updates in this PR

Contribution checklist:

[ ] I commit to follow the Breaking Change Policy of “no breaking changes
[ ] I have reviewed the documentation for the workflow.
[ ] Validation tools were run on swagger spec(s) and errors have all been fixed in this PR. How to fix?

If any further question about AME onboarding or validation tools, please view the FAQ.
ARM API Review Checklist

[ ] Ensure to check this box if one of the following scenarios meet updates in the PR, so that label “WaitForARMFeedback” will be added automatically to involve ARM API Review. Failure to comply may result in delays for manifest application. Note this does not apply to data plane APIs, all “removals” and “adding a new property” no more require ARM API review.

Adding new API(s)
Adding a new API version
Adding a new service

[ ] Please ensure you've reviewed following guidelines including ARM resource provider contract and REST guidelines. Estimated time (4 hours). This is required before you can request review from ARM API Review board.

[ ] If you are blocked on ARM review and want to get the PR merged with urgency, please get the ARM oncall for reviews (RP Manifest Approvers team under Azure Resource Manager service) from IcM and reach out to them.

Breaking Change Review Checklist
If there are following updates in the PR, ensure to request an approval from API Review Board as defined in the Breaking Change Policy.

[ ] Removing API(s) in stable version
[ ] Removing properties in stable version
[ ] Removing API version(s) in stable version
[ ] Updating API in stable version with Breaking Change Validation errors
[ ] Updating API(s) in preview over 1 year

Action: to initiate an evaluation of the breaking change, create a new intake using the template for breaking changes. Addition details on the process and office hours are on the Breaking change Wiki.
Please follow the link to find more details on PR review process.

@Sandido is this PR still valid?

Hi @Sandido since we have already release the 2020-12-01 compute package in stable, I assume we would not need this PR anymore. Therefore I am closing this PR. Please feel free to reopen if this is still valid. Thanks

Hi, @Sandido. The PR has be closed for a long time and it's related branch still exist. If no further used for over 14 days, I will delete this related branch. Please tell me if you still need this branch.

Hi, @Sandido. The PR has be closed for a long time and it's related branch still exist. Please tell me if you still need this branch or i will delete it in 14 days.

Hi, @Sandido. The PR has be closed for a long time and it's related branch still exist. Please tell me if you still need this branch or i will delete it in 14 days.

Hi, @Sandido. The PR has be closed for a long time and it's related branch still exist. Please tell me if you still need this branch or i will delete it in 14 days.


Improve SubApp documentation example

Objective
Fix #15841
Solution
Added an update schedule as recommended in the issue.
Testing
Doc test is run and passes.
Ran the example in a test app before and after adding the line.
Showcase
Before:
PS C:\Users\BenjaminBrienen\source\bevy_experiment_test> cargo run
    Blocking waiting for file lock on build directory
   Compiling bevy_experiment_test v0.1.0 (C:\Users\BenjaminBrienen\source\bevy_experiment_test)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 1m 41s
     Running `target\debug\bevy_experiment_test.exe`

(nothing happens)
After:
PS C:\Users\BenjaminBrienen\source\bevy_experiment_test> cargo run
    Blocking waiting for file lock on build directory
   Compiling bevy_experiment_test v0.1.0 (C:\Users\BenjaminBrienen\source\bevy_experiment_test)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 14.64s
     Running `target\debug\bevy_experiment_test.exe`
system of subapp is executing and the Counter: 10

@RamonBrisk can I get your review here?

@RamonBrisk can I get your review here?

This PR effectively improves the SubApp documentation example (#15841) by adding an update schedule, which resolves the previous unresponsive issue in the example.


Discussion about LiquidCore performances

Hi 👋
I'm currently in the process of rolling out LiquidCore as a replacement for an old JS engine we're using (jv8). The problem I'm encountering is that LiquidCore is slower compared to the other JS engine. I've compared the two engines using the below script:
for (var i=0; i < 1024; i++) { nativeFunction(i + 0.0); }

on the native side nativeFunction is only keeping the sum of all the indexes. Below are my test results:

LiquidCore runs in 1153ms
V8Runner runs in 26ms

I've created a public GH repo with the test project I've built in order to run the tests https://github.com/capezzbr/JSEnginesPlayground/ (feel free to have a look).

I'm wondering if there is any way we could improve LiquidCore to be more performant. My first guess is that LiquidCore is slower since it's using reflection to obtain the native call JS wants to invoke. Ideas?

👋 @ericwlange, sorry for the bump, just wondering if you could think at a way I could improve the performances?

I've been thinking about this, though I haven't been able to dedicate time to it yet.  jv8 also uses reflection, albeit at a much simpler level.  Thanks for putting the project together.  I will try put some time into it this weekend.

@ericwlange thanks for looking into that, let me know if I can help somehow, I'll be more than happy to test any future implementation 👍

@capezzbr I found some low hanging fruit and picked it.  It improves the speed by 4x.
Test on my emulator with 0.4.5:
02-17 10:07:12.581 26359-26359/? I/RESULT: LiquidCore run in 120ms
02-17 10:07:12.621 26359-26359/? I/RESULT: V8Runner run in 3ms

Test on my emulator with latest changes:
02-17 10:03:51.498 26239-26239/? I/RESULT: LiquidCore run in 38ms
02-17 10:03:51.529 26239-26239/? I/RESULT: V8Runner run in 3ms

Test with 0.4.5 on real hardware (Lenovo Tablet, API 23):
02-17 11:13:31.568 8094-8094/capezzbr.liquidcoreplayground I/RESULT: LiquidCore run in 786ms
02-17 11:13:31.699 8094-8094/capezzbr.liquidcoreplayground I/RESULT: V8Runner run in 11ms

Test with changes on tablet (much better than 4x):
02-17 11:47:54.168 10264-10264/? I/RESULT: LiquidCore run in 170ms
02-17 11:47:54.258 10264-10264/? I/RESULT: V8Runner run in 10ms

Pixel, 0.4.5:
02-17 11:39:31.324 5993-5993/capezzbr.liquidcoreplayground I/RESULT: LiquidCore run in 444ms
02-17 11:39:31.379 5993-5993/capezzbr.liquidcoreplayground I/RESULT: V8Runner run in 12ms

Pixel, latest:
02-17 11:37:39.979 5673-5673/capezzbr.liquidcoreplayground I/RESULT: LiquidCore run in 166ms
02-17 11:37:40.044 5673-5673/capezzbr.liquidcoreplayground I/RESULT: V8Runner run in 14ms

It is checked in if you'd like to try it.  Obviously LQ is still an order of magnitude slower.  I will have to dig into the Java side to see if there are ways to reduce the overhead.

@ericwlange wow, that looks promising. Just updated the app I'm working on to use com.github.LiquidPlayer:LiquidCore:master-SNAPSHOT, and the speed improvements are definitely noticeably, great work 👏.

I will have to dig into the Java side to see if there are ways to reduce the overhead.

That would be awesome, I feel that if LQ would be as performant as jv8 I'll be definitely able to switch to use LQ in production, since it is way more stable and I like the fact that I can use almost the same API I'm using on the twin iOS app 👍 let me know if there is anything I could help with 🙏

Just a quick update on this.  I found many sources of the slowness, and most all if it is related to reflection.  I have a version that is twice as fast as the one I sent you last (not checked in yet), but there is still more to do.  I will spend some time on it this weekend and let you know when something is ready to test.

That sounds fantastic, thanks again for looking into that 👍

Ok, please give the latest a try ...
My emulator:
03-04 12:19:18.477 16198-16198/? I/RESULT: V8Runner run in 4ms
03-04 12:19:18.511 16198-16198/? I/RESULT: LiquidCore run in 17ms

There is obviously still some difference between the two, but J2V8 is an incredibly thin (and hence, less feature-rich) wrapper around V8 so it will be difficult to achieve quite that level.  I do think there is some more that I can do, but it will all be on the margin at this point.  Can you see if this meets your needs?  I will test it some more and put it into a release if you're satisfied.
Thanks!

Hey @ericwlange, just tested your latest improvements on the app I'm working on, and the performance improvement are fantastic 👏

There is obviously still some difference between the two, but J2V8 is an incredibly thin (and hence, less feature-rich) wrapper around V8 so it will be difficult to achieve quite that level.

That makes totally sense 👍

I have released version 0.4.6.  Made some more big improvements.  I can see some more opportunities for improvement, but it would require a pretty invasive re-write of the C++ code, so I will just leave that as a project for later.  Latest tests with release version:
Emulator:
03-11 09:28:43.255 3820-3820/? I/RESULT: V8Runner run in 5ms
03-11 09:28:43.277 3820-3820/? I/RESULT: LiquidCore run in 10ms

Ancient Samsung Galaxy Nexus (API 18):
03-11 10:30:43.918 5423-5423/capezzbr.liquidcoreplayground I/RESULT: V8Runner run in 101ms
03-11 10:30:44.215 5423-5423/capezzbr.liquidcoreplayground I/RESULT: LiquidCore run in 200ms

So, for this particular test, LiquidCore is still about half the speed as J2V8, but obviously much closer in performance.
Let me know if you have any issues with this version!

Hey @ericwlange thanks a lot for the hard work on investigating on those performance improvements 👏 Will definitely check out the new version soon and let you know if I find anything off 👍


Issue744 test v4 fees (not including reuse order test)

Fixes #744  .
Changes proposed in this PR:

Discovered bug where user could effectively swap without paying fees using BPool.join_swap_extern_amount_in() and BPool.exit_pool(). BPool.join_pool() and Bpool.exit_pool() have since been removed.
Fix bug where Ocean.create_pool() always set publish_market_swap_fee_collector to the OPC Community fee collector address. Add publish_market_swap_fee_collector argument to Ocean.create_pool()
Improve pool swap fees tests (see test_pool_swap_fees.py):

Drastically reduce the file size from >5000 lines down to <1000 lines.
Add more assertions - check all balances and events related to swap fees.
Add test cases for minimum fees and maximum fees.

Add exchange swap fee tests (see test_exchange_swap_fees.py).
Add start order fee tests (see test_start_order_fees.py).
Add tests that show interactions between pools, exchanges, and dispensers (see test_multiple_pools.py)
Refactor test_consume_flow.py, move appropriate parts of it to test_erc721_token.py and test_erc20_token.py.
Move test_deploy_erc721_and_manage from test_swap_fees.py to test_erc721_factory.py
Update bfactory.py, bpool.py, erc20_token.py, factory_router.py, and fixed_rate_exchange.py to match smart contracts.

BFactory.new_bpool is internal, not callable by external users/contracts.
joinPool, exitPool have been removed.
erc20_token.py was missing methods for removing single permissions.
factory_router and fixed_rate_exchange were missing methods to get current fee amounts.

Add MetadataState and Flags convenience enums (copied from Provider)
Update transfer_ocean_if_balance_lte to support any base token
Add Ocean.side_staking() and Ocean.pool_template_address()
Change default encrypt_flag and compress_flag arguments to True
Create test helper methods: base_token_to_datatoken and approx_from_wei

TODO

This PR does not include reuse order fee tests. Plan to create them after #793 completed and reuse order flow changes are complete.

@DMats can you also fix conflicts and use coverage lines to fix the coverage decrease?

By the way, do you think we need to create a readme explaining the fees somewhere? I understand there's an internal or quasi-internal document, but are there any official docs to this? If they shouldn't reside in ocean.py, I'm happy with just linking to them somewhere.

That's a good thought! I don't think we need a dedicated README in ocean.py because they're already documented in the following places:
Fees are documented here: https://github.com/oceanprotocol/docs/blob/main/content/concepts/fees.md
Publicly viewable here: https://docs.oceanprotocol.com/concepts/fees/

@DMats can you also fix conflicts and use coverage lines to fix the coverage decrease?
Yes I can do that.  I haven't completed it yet.

@calina-c I pushed changes that I believe will bring the test coverage back up to where it was before. And I think I've addressed all your other comments.  So I'm re-requesting your review.

@DMats can you also fix the conflicts, please?

My intention is to make a new PR for the reuse order tests.

Approved structurally, LGTM. Feel free to merge once the failing tests pass.

Approved structurally, LGTM. Feel free to merge once the failing tests pass.

I believe I'll be able to fix the tests after https://github.com/oceanprotocol/contracts/pull/653 is merged and released

@calina-c I ended up adding the reuse-order fees tests to this PR.  (I had meant to put them in a new PR, but accidentally committed and pushed them here before realizing my mistake).
Can you please review the new file test_reuse_order_fee_tests.py? https://github.com/oceanprotocol/ocean.py/pull/763/files#diff-dae7660ed4b09bb8c4a4bc9403e1f490abfb09e572832eba483dace32b42ea27


@BundleProperty getXXX() also needs to check getArguments() == null

If I have this fragment:
class MyFrag extends DialogFragment {
   @BundleProperty String message

   @OnCreate
   def init() {
      if (message == null) return;
   }
}

then call it like so:
  var myFrag = new MyFrag()
  myFrag.show(supportFragmentManager, "myfrag")

then it throws a NPE at the if (message == null)... part, because the generated getMessage() does not first check if getArguments() == null.

What is desirable?

Add a default ctor via @Android*Fragment, that sets up a Fragment#setArguments(new Bundle)
Add more boilerplate to the getters generated by @BundleProperty with something like

if (getArguments() == null) { throw new «toJavaCode(IllegalAccessException.newTypeReference)»("Missing Bundle instance"); }

I was thinking if (getArguments() == null) { // return the default value }

If there is a default value, iirc think I defined this for primitives.
This was back in the days, when I wrote the code without setting up a unit test :P


Failed to publish publication 'release' to repository 'maven'
Could not write to resource 'https://xxxxxx'.
PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

this is my gradle file
import java.nio.file.Paths
import org.gradle.api.Project
import org.gradle.api.artifacts.Configuration
import org.gradle.api.publish.maven.MavenPublication

void configureProject(Project project, String outputDir) {
    if (!project.hasProperty("android")) {
        throw new GradleException("Android property not found.")
    }
    if (!project.android.hasProperty("libraryVariants")) {
        throw new GradleException("Can't generate AAR on a non Android library project.");
    }

    // Snapshot versions include the timestamp in the artifact name.
    // Therefore, remove the snapshot part, so new runs of `flutter build aar` overrides existing artifacts.
    // This version isn't relevant in Flutter since the pub version is used
    // to resolve dependencies.
    project.version = project.version.replace("-SNAPSHOT", "")

    if (project.hasProperty("buildNumber")) {
        project.version = project.property("buildNumber")
    }

    project.android.libraryVariants.all { variant ->
        addAarTask(project, variant)
    }

    project.publishing {
        repositories {

            maven {

                url = 'mymavenurl'//this is my url,it's really exist
                credentials {
                    username = 'deploy'
                    password = 'deploy'
                }
            }
        }
    }

    // Some extra work to have alternative publications with the same format as the old maven plugin.
    // Instead of using classifiers for the variants, the old maven plugin appended `_{variant}` to the artifactId

    // First, create a default MavenPublication for each variant (except "all" since that is used to publish artifacts in the new way)
    project.components.forEach { component ->
        if (component.name != "all") {
            project.publishing.publications.create(component.name, MavenPublication) {
                from component
            }
        }
    }

    // then, rename the artifactId to include the variant and make sure to remove any classifier
    // data tha gradle has set, as well as adding a <relocation> tag pointing to the new coordinates
    project.publishing.publications.forEach { pub ->
        def relocationArtifactId = pub.artifactId
        pub.artifactId = "${relocationArtifactId}_${pub.name}"
        pub.alias = true

        pub.pom.distributionManagement {
            relocation {
                // New artifact coordinates
                groupId = "${pub.groupId}"
                artifactId = "${relocationArtifactId}"
                version = "${pub.version}"
                message = "Use classifiers rather than _variant for new publish plugin"
            }
        }

    }

    // also publish the artifacts in the new way, using one set of coordinates with classifiers
    project.publishing.publications.create("all", MavenPublication) {
        from project.components.all
        alias false
    }

    if (!project.property("is-plugin").toBoolean()) {
        return
    }

    String storageUrl = System.getenv('FLUTTER_STORAGE_BASE_URL') ?: "https://storage.googleapis.com"
    // This is a Flutter plugin project. Plugin projects don't apply the Flutter Gradle plugin,
    // as a result, add the dependency on the embedding.
    project.repositories {
        maven {
            url "$storageUrl/download.flutter.io"
        }
    }
    String engineVersion = Paths.get(getFlutterRoot(project), "bin", "internal", "engine.version")
            .toFile().text.trim()
    project.dependencies {
        // Add the embedding dependency.
        compileOnly ("io.flutter:flutter_embedding_release:1.0.0-$engineVersion") {
            // We only need to expose io.flutter.plugin.*
            // No need for the embedding transitive dependencies.
            transitive = false
        }
    }
}

void configurePlugin(Project project, String outputDir) {
    if (!project.hasProperty("android")) {
        // A plugin doesn't support the Android platform when this property isn't defined in the plugin.
        return
    }
    configureProject(project, outputDir)
}

String getFlutterRoot(Project project) {
    if (!project.hasProperty("flutter-root")) {
        throw new GradleException("The `-Pflutter-root` flag must be specified.")
    }
    return project.property("flutter-root")
}

void addAarTask(Project project, variant) {
    String variantName = variant.name.capitalize()
    String taskName = "assembleAar$variantName"
    project.tasks.create(name: taskName) {
        // This check is required to be able to configure the archives before `publish` runs.
        if (!project.gradle.startParameter.taskNames.contains(taskName)) {
            return
        }
        // Generate the Maven artifacts.
        finalizedBy "publish"
    }
}

// maven-publish has to be applied _before_ the project gets evaluated, but some of the code in
// `configureProject` requires the project to be evaluated. Apply the maven plugin to all projects, but
// only configure it if it matches the conditions in `projectsEvaluated`

allprojects {
    apply plugin: "maven-publish"
}

projectsEvaluated {
    assert rootProject.hasProperty("is-plugin")
    if (rootProject.property("is-plugin").toBoolean()) {
        assert rootProject.hasProperty("output-dir")
        // In plugin projects, the root project is the plugin.
        configureProject(rootProject, rootProject.property("output-dir"))
        return
    }
    // The module project is the `:flutter` subproject.
    Project moduleProject = rootProject.subprojects.find { it.name == "flutter" }
    assert moduleProject != null
    assert moduleProject.hasProperty("output-dir")
    configureProject(moduleProject, moduleProject.property("output-dir"))

    // Gets the plugin subprojects.
    Set<Project> modulePlugins = rootProject.subprojects.findAll {
        it.name != "flutter" && it.name != "app"
    }
    // When a module is built as a Maven artifacts, plugins must also be built this way
    // because the module POM's file will include a dependency on the plugin Maven artifact.
    // This is due to the Android Gradle Plugin expecting all library subprojects to be published
    // as Maven artifacts.
    modulePlugins.each { pluginProject ->
        configurePlugin(pluginProject, moduleProject.property("output-dir"))
        moduleProject.android.libraryVariants.all { variant ->
            // Configure the `assembleAar<variantName>` task for each plugin's projects and make
            // the module's equivalent task depend on the plugin's task.
            String variantName = variant.name.capitalize()
            moduleProject.tasks.findByPath("assembleAar$variantName")
                    .dependsOn(pluginProject.tasks.findByPath("assembleAar$variantName"))
        }
    }
}

it seens like the code
credentials {
username = 'deploy'
password = 'deploy'
}
dose not work
how should I do this????
thanks

Hi @yilingfeixian
Can you provide a completed and minimal reproducible code sample along with detailed Steps to reproduce so that we may verify this? Also, please provide the output of flutter doctor -v as well. Thank you!


Settings -  Buttons are not grey out if user switches to offline at another place

If you haven’t already, check out our contributing guidelines for onboarding and email<EMAIL_ADDRESS>to request to join our Slack channel!

Action Performed:

Launch the Expensify ND App
Switch to offline mode while at LHN
Go to Settings > Security > Close Account or Settings > Payments

Expected Result:
Button 'Close Account' is greyed out
Button 'Add payment method' is greyed out
Actual Result:
Button 'Close Account' is NOT greyed out
Button 'Add payment method' is NOT greyed out
Workaround:
Unknown
Platforms:

Which of our officially supported platforms is this issue occurring on?

[ ] Android / native
[ ] Android / Chrome
[x] iOS / native
[ ] iOS / Safari
[x] MacOS / Chrome / Safari
[x] MacOS / Desktop

Version Number: <IP_ADDRESS>
Reproducible in staging?: Yes
Reproducible in production?: No
Notes/Photos/Videos:
https://user-images.githubusercontent.com/93399543/235251934-fa5deccc-b02e-4f65-a2c0-777b813c36b8.mp4
https://user-images.githubusercontent.com/93399543/235251944-be2c7035-ae44-4e51-9f86-cc5efad33e9d.mp4
Issue reported by: Applause - Internal Team
View all open jobs on GitHub

:wave: Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open StagingDeployCash deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

Identify the pull request that introduced this issue and revert it.
Find someone who can quickly fix the issue.
Fix the issue yourself.

Triggered auto assignment to @cead22 (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.

Probably this PR should be fixing this regression

⚠ Looks like this issue was linked to a Deploy Blocker here
If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.
If a regression has occurred and you are the assigned CM follow the instructions here.
If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

@kbecciv it looks like expected results and actual results isn't accurate, since from what I can see in the video, this is about the close account button being enabled/disabled while online/offline. Can you confirm and update those sections please? Also check out the edits I made to the description already, and let me know what you think about removing all the items for which we're not adding information in these issues to remove some of the noise

Separately, I understand this is happening on staging and not production, but this doesn't feel like a bug that's worth blocking a deploy over

@cead22 My apologies, corrected the expected results and actual results.

It looks like the fix was CP'ed to staging, and I can't reproduce on staging web. @kbecciv @robertKozik can you?

Agree with the assessment above. Seems fixed (though I did not test iOS) - and not worth blocking the deploy on.


Configurable Dimension-based Teleport Ban [Suggestion]

Having GTP and Blink banned in some dimensions like the Twilight Forest where they break progression would be helpful for packmakers, and having it configurable even more so.

Sure, I think I can even make it a tag


installer: Only install efi library on x86_64 systems

Signed-off-by: Stefan Berger<EMAIL_ADDRESS>

Does this mean we can only do measured boot on backends that are 64bit? Probably not a bit deal, but seems like we should document it somewhere...

The library only exists on x86_64 and possibly ARM, not on s390 or ppc64.


Promoting the simple TCP server to be run from the command line

Add a simple TCP server in tcpgoon CLI, with basic input parameters (port, parallel connections, etc)
Add simple end to end tests using tcpgoon client and validating the expected result

CI in Travis is failing on the new end-to-end test but the local ./_script/cibuild-docker works fine. still trying to figure it out.

Coverage increased (+0.2%) to 59.893% when pulling 96ea6a046697c368f1efc5a3882840c366fda876 on end-to-end-test into c81ad5c57fa74b7941e96e4b4b176cb04ef6e830 on master.


WIP Issue 1062/expand color palette flexibility

Closes #1062 issue
Related to #1103 discussion
📝 Description

Add a brief description

⛳ Current behavior (updates)

Please describe the current behavior that you are modifying

🚀 New behavior

Please describe the behavior or changes this PR adds

💣 Is this a breaking change (Yes/No):

📝 Additional Information

What’s the status of this @isBatak?

I'm closing this for now. Kindly re-open when you have a working POC or ready for review.

On a quick glance, it feels a bit too complex for the benefit it brings, but I could be wrong.

@segunadebayo it's ready for review


add CI instruction for conditional benchmark job

demo: https://github.com/JuliaImages/ImageContrastAdjustment.jl/pull/37
Commit Message
Add CI instruction for conditional benchmark job (#65)

Thanks!  This looks like a very useful setting!  I didn't know about the labeled event type.


Minor: Log formatting for exceptions during configuration related operations

Format configuration logging during exceptions or errors.
Also make sure it redacts sensitive information or unknown values.
Committer Checklist (excluded from commit message)

[ ] Verify design and implementation
[ ] Verify test coverage and CI build status
[ ] Verify documentation (including upgrade notes)

@dajac @kowshik @showuon could you help review this PR? thank you!

@YiDing-Duke Thanks for the update.
@showuon Does the PR look good to you now?

@dajac we are good to go.

@YiDing-Duke Thanks for the patch! Merging to trunk and 2.8.


fix: normalize the k8s workload to fix a deep-copy int error

What type of PR is this?
/kind bug

What this PR does / why we need it:
Which issue(s) this PR fixes:

Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?

Additional documentation e.g., design docs, usage docs, etc.:

Pull Request Test Coverage Report for Build<PHONE_NUMBER>
Details

7 of 11 (63.64%)  changed or added relevant lines in 1 file are covered.
No unchanged relevant lines lost coverage.
Overall coverage increased (+0.004%) to 54.354%

Changes Missing Coverage
Covered Lines
Changed/Added Lines
%

pkg/modules/generators/app_configurations_generator.go
7
11
63.64%

Totals

Change from base Build<PHONE_NUMBER>:
0.004%

Covered Lines:
8883

Relevant Lines:
16343

💛  - Coveralls


iis_application

I am getting the following error when trying to create an iis_application:
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Syntax error at 'site' at /etc/puppetlabs/code/environments/ql_nonprod/site/profile/manifests/windows/iis/modulename.pp:62:5 on node nodename
I am passing the site name correctly but it just keeps blowing up on me here.  I am honestly not sure what I am doing wrong here.

Site is now a reserved word with the introduction of Application Orchestration.  This module needs to be changed to use a different parameter.

We are running into the same issue and it will be helpful, if we know when is the fix coming and when can we download the updated module.

Hi. I'm going to close this Issue. We deprecated the module and the new version is available here: https://forge.puppet.com/puppetlabs/iis


feature: in-order streaming and async rendering

See discussion in #420.
To do

[x] in-order streaming rendering
[x] hydration
Build into Actix/Axum integrations

[x] Actix
[x] Axum

[x] async rendering
[ ] refactor Axum
[ ] per-route rendering strategies
[ ] testing

Very excited for this, keep it up!


nits: sort imports, doc typos, minor cleanups

factored out of #612

@ryan-williams Thanks for the PR. We would be glad to get this PR and #218 + #323 going once we have merged #580 which is a significant change on master.

"Python tests on ubuntu-latest" failed, GHA log says:
This step has been truncated due to its large size. Download the full logs from the  menu once the workflow run has completed.

I downloaded the logs and see this toward the end of 1_tests  Python tests on ubuntu-latest.txt (48M):
2022-01-06T15:30:01.2401382Z [pid 1759] ### The following tests failed: ###
2022-01-06T15:30:01.2402956Z [pid 1759] ### test 'CardTimeoutTest' graph 'simple-foreach' in context python3-all-local ###
2022-01-06T15:30:01.2404842Z [pid 1759] ### test 'CardTimeoutTest' graph 'single-and-branch' in context python3-all-local ###
2022-01-06T15:30:01.2406043Z [pid 1759] ### test 'CardTimeoutTest' graph 'nested-foreach' in context python3-all-local ###
2022-01-06T15:30:01.2407218Z [pid 1759] ### test 'CardTimeoutTest' graph 'nested-branches' in context python3-all-local ###
2022-01-06T15:30:01.2408392Z [pid 1759] ### test 'CardTimeoutTest' graph 'single-linear-step' in context python3-all-local ###
2022-01-06T15:30:01.2409566Z [pid 1759] ### test 'CardTimeoutTest' graph 'small-foreach' in context python3-all-local ###
2022-01-06T15:30:01.2410920Z [pid 1759] ### test 'CardTimeoutTest' graph 'small-parallel' in context python3-all-local ###
2022-01-06T15:30:01.3857245Z ERROR: InvocationError for command /home/runner/work/metaflow/metaflow/test_runner (exited with code 1)
2022-01-06T15:30:01.3860641Z ___________________________________ summary ____________________________________
2022-01-06T15:30:01.3861286Z ERROR:   python: commands failed
2022-01-06T15:30:01.4089259Z ##[error]Process completed with exit code 1.

Not sure what that is about. investigating…

I think this is ready for review

going through some older PR's, this seems like a straightforward one to push through. Would you still be available for rebasing it against the latest master ?


TitleBar seems doesn't work correctly on Windows

See https://github.com/romainguy/kotlin-explorer/pull/7#issuecomment-1931549030
Windows 11 (10.0.22631)

How do you build the menu in Windows?

When using custom titlebar the default window menu can not be used, you can add a custom menu in custom titlebar just like the JetBrains do.

How do you build the menu in Windows?
https://github.com/romainguy/kotlin-explorer/blob/136413d03f6f45811f771d5a7d6b3a9c9fa2b3c7/src/jvmMain/kotlin/dev/romainguy/kotlin/explorer/KotlinExplorer.kt#L115

Is this still relevant? Is there anything we can do?

I have to take a look at the standalone sample. But it seems the org.JetBrains.jewel.ui.component.Dropdown doesn't work correctly either on https://github.com/romainguy/kotlin-explorer.

That's odd because we do have a drop-down in our standalone sample and we don't have issues with it (that I know of, obviously). @devkanro can you investigate when you have some time?

@rock3r  sure, looking into this

@devkanro Yes, it has SwingPanel inside. I also encounter similar things like https://github.com/JetBrains/compose-multiplatform/issues/3206.
I will rewrite all of them into Compose. Since I'm quite busy at the moment, I probably won't be able to finish it soon. You can close this issue for now.

Yeah, the Swing interop has some serious limitations/issues for non-trivial use cases, as I well know. Will close for now then, let us know if things don't work correctly when using pure Compose!