Unable to annotate union names with generics

Describe the Bug
Strawberry's automatic type-naming for generics is ignoring annotated types on unions. Here are a few examples of what I've tried:
This causes the union type to be named SomeTypeNotFoundError:
from typing import Annotated, Generic, TypeVar, Union
import strawberry

from my_types import OtherType, SomeType

@strawberry.type
class NotFoundError:
    id: strawberry.ID
    message: str

T = TypeVar('T')

@strawberry.type
class ObjectQueries(Generic[T]):
    ...

    @strawberry.field
    def by_id(self, id: strawberry.ID) -> Annotated[Union[T, NotFoundError], strawberry.union("ByIdResult")]:
        ...

    ...

@strawberry.type
class Query:

    @strawberry.field
    def some_type_queries(self, id: strawberry.ID) -> ObjectQueries[SomeType]:
        return ObjectQueries(SomeType)

    @strawberry.field
    def other_type_queries(self, id: strawberry.ID) -> ObjectQueries[OtherType]:
        return ObjectQueries(OtherType)

schema = strawberry.Schema(Query)

This causes TypeError: SomeTypeObjectQueries fields cannot be resolved.:
from typing import Annotated, Generic, TypeVar, Union
import strawberry

from my_types import OtherType, SomeType

@strawberry.type
class NotFoundError:
    id: strawberry.ID
    message: str

T = TypeVar('T')

@strawberry.type
class ObjectQueries(Generic[T]):
    ...

    @strawberry.field
    # NOTE annotaion moved to just the union
    def by_id(self, id: strawberry.ID) -> Union[T, Annotated[NotFoundError, strawberry.union("ByIdResult")]]:
        ...

    ...

@strawberry.type
class Query:

    @strawberry.field
    def some_type_queries(self, id: strawberry.ID) -> ObjectQueries[SomeType]:
        return ObjectQueries(SomeType)

    @strawberry.field
    def other_type_queries(self, id: strawberry.ID) -> ObjectQueries[OtherType]:
        return ObjectQueries(OtherType)

schema = strawberry.Schema(Query)

Pulling the definition up has the same behaviour in both cases:
from typing import Annotated, Generic, TypeVar, Union
import strawberry

from my_types import OtherType, SomeType

@strawberry.type
class NotFoundError:
    id: strawberry.ID
    message: str

T = TypeVar('T')

ByIdResult = Annotated[Union[T, NotFoundError], strawberry.union("ByIdResult", (T, NotFoundError))]
# NOTE this does the same thing, but with a linter warning:
# ByIdResult = strawberry.union("ByIdResult", (T, NotFoundError))

@strawberry.type
class ObjectQueries(Generic[T]):
    ...

    @strawberry.field
    # NOTE annotaion moved to just the union
    def by_id(self, id: strawberry.ID) -> ByIdResult:
        ...

    ...

@strawberry.type
class Query:

    @strawberry.field
    def some_type_queries(self, id: strawberry.ID) -> ObjectQueries[SomeType]:
        return ObjectQueries(SomeType)

    @strawberry.field
    def other_type_queries(self, id: strawberry.ID) -> ObjectQueries[OtherType]:
        return ObjectQueries(OtherType)

schema = strawberry.Schema(Query)

Specifying T in the union doesn't help
from typing import Annotated, Generic, TypeVar, Union
import strawberry

from my_types import OtherType, SomeType

@strawberry.type
class NotFoundError:
    id: strawberry.ID
    message: str

T = TypeVar('T')

ByIdResult = Union[T, Annotated[NotFoundError, strawberry.union("ByIdResult")]]

@strawberry.type
class ObjectQueries(Generic[T]):
    ...

    @strawberry.field
    # NOTE annotaion moved to just the union
    def by_id(self, id: strawberry.ID) -> ByIdResult[T]:
        ...

    ...

@strawberry.type
class Query:

    @strawberry.field
    def some_type_queries(self, id: strawberry.ID) -> ObjectQueries[SomeType]:
        return ObjectQueries(SomeType)

    @strawberry.field
    def other_type_queries(self, id: strawberry.ID) -> ObjectQueries[OtherType]:
        return ObjectQueries(OtherType)

schema = strawberry.Schema(Query)

Splitting out the error union doesn't help, this also can't resolve fields:
from typing import Annotated, Generic, TypeVar, Union
import strawberry

from my_types import OtherType, SomeType

@strawberry.type
class NotFoundError:
    id: strawberry.ID
    message: str

T = TypeVar('T')

ByIdError = Annotated[NotFoundError, strawberry.union("ByIdError")]

@strawberry.type
class ObjectQueries(Generic[T]):
    ...

    @strawberry.field
    # NOTE annotaion moved to just the union
    def by_id(self, id: strawberry.ID) -> T | ByIdError:
        ...

    ...

@strawberry.type
class Query:

    @strawberry.field
    def some_type_queries(self, id: strawberry.ID) -> ObjectQueries[SomeType]:
        return ObjectQueries(SomeType)

    @strawberry.field
    def other_type_queries(self, id: strawberry.ID) -> ObjectQueries[OtherType]:
        return ObjectQueries(OtherType)

schema = strawberry.Schema(Query)

System Information

Operating system: macOS Ventura 13.2.1
Strawberry version (if applicable): 0.218.0

Additional Context
It appears that the issue with the ones that raise an exception rather than simply having the wrong names have their problem stemming from not being able to from a union with an instance of strawberry.union
Other potentially related issues

#3289
#2959
#3381

Upvote & Fund

We're using Polar.sh so you can upvote and help fund this issue.
We receive the funding once the issue is completed & confirmed by you.
Thank you in advance for helping prioritize & fund our backlog.

From what I can tell Union[T, Annotated[EntityNotFoundError, strawberry.union("ByIdResponse")]] "should" be the correct format for this. However, when compiling to GraphQL, Annotated[EntityNotFoundError, strawberry.union("ByIdResponse")] is first compiled to a GraphQLUnionType before attempting to create an invalid Type | Union union, which is invalid.
Union merging functionality such as with #711. Does anyone know a workaround for this? Either via union merging or naming unions that contain a TypeVar?

Make a quick-and-dirty patch that merges unions and it worked exactly as I expected. The patch also caused 70 test failures, so I didn't exactly fix it 😅 but yes, union merging would fix this.

@jacobmoshipco is this still valid? would you like to share the patch and see if we can fix the tests? 😊

@patrick91 I'll have to check if I still have it on my home computer; I'll get back to you on that. I think it caused some other issues with unions, though.

(just switching accounts, I'm the same person as @jacobmoshipco)
/strawberry/schema/schema_converter.py, GraphQLCoreConverter.from_union
859c859
<             assert isinstance(graphql_type, GraphQLObjectType)
---
>             assert isinstance(graphql_type, GraphQLObjectType | GraphQLUnionType)
861c861,864
<             graphql_types.append(graphql_type)
---
>             if isinstance(graphql_type, GraphQLUnionType):
>                 graphql_types += list(graphql_type.types)
>             else:
>                 graphql_types.append(graphql_type)

Tests:
Without patch: 69 failed, 2727 passed, 160 skipped, 9 xfailed, 13 xpassed, 82 warnings in 356.93s (0:05:56)
With patch: 69 failed, 2727 passed, 160 skipped, 12 xfailed, 10 xpassed, 82 warnings in 431.60s (0:07:11)
Tbh, I may have just forgotten to do a proper control test when testing it before. Unless you (@patrick91) think this is the wrong way to patch this, or that it would cause too much of a breaking change (it does rename some unions), I can go ahead and submit it as a PR.

@enoua5 feel free to send the PR, I'll be happy to check the failures 😊


AbstractTask has a piece of useless code

Search before asking

[X] I had searched in the issues and found no similar issues.

What happened

this code is useless .
We can consider deleting its code
What you expected to happen
no
How to reproduce
no
Anything else
no
Version
1.3.9
Are you willing to submit PR?

[X] Yes I am willing to submit a PR!

Code of Conduct

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

Please fix the relevant code of the dev branch.

ok
------------------ 原始邮件 ------------------
发件人:                                                                                "apache/dolphinscheduler"                                                                                @.>;
发送时间: 2021年11月17日(星期三) 上午9:48
@.>;
<EMAIL_ADDRESS>主题: Re: [apache/dolphinscheduler] AbstractTask has a piece of useless code (Issue #6873)
Please fix the relevant code of the dev branch.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.


Newlines affect suggestions

Hello and thank you for this package!
I have experienced the following issue. When splitting a sentence across multiple lines (I have been using auto-fill in my buffers)
the suggestions are wrong.
MWE:
The successive construction of the model from finer to coarser blocks not only improves the efficiency but also increases the quality.

The successive construction of the model from finer to coarser
blocks not only improves the efficiency but also increases the
quality.

The first example raises no issues.
In the second case, I get errors on improves and increases because it identifies the blocks as the subject.
Is there any way to remove single-line breaks from the parser?

I get this error on both Emacs (see the issue here) and in VSCode.

Thanks!

I am seeing the same issue, this currently leads to a lot of false positives for me. Any chance this can be fixed?

Just reporting that I'm having the same issue on LaTeX.

I also see this issue. It would be great if it could be resolved.


shielded-pool: remove unwrap

Describe your changes
Remove unwrap() calls added in #4404 that made #![deny(clippy::unwrap_used)] unhappy.
See also #2920.
Checklist before requesting a review

[X] If this code contains consensus-breaking changes, I have added the "consensus-breaking" label. Otherwise, I declare my belief that there are not consensus-breaking changes, for the following reason:

no functionality change

These unwraps are gated behind is_err, so no risk there. In the interest of not touching potentially consensus breaking code, we should keep the expects in there for now.


Annotation tool for relation extraction

Thanks for this amazing tool, it works very well.
Would you know of a data annotation tool for relation extraction? I tried searching the web but couldnt find a tool that can accomplish relation extraction. UBAI tool is paid service and doesnt work well for custom model. It would be great if you can recommend  an unpaid tool for relation extraction.

@MarurSrikanta I don't know of any such tools.


How to reorder functions from the design view

 Issue by yasassri
Thursday Oct 12, 2017 at 13:08 GMT
Originally opened as https://github.com/ballerina-lang/composer/issues/3638

Is it possible to reorder functions and other elements from the design view?

Composer is discontinued hence closing the issue.


bug: Investigate quirks of (auto) installing plugins when there's multiple levels of inheritance

Meltano Version
3.5.2
Python Version
3.12
Bug scope
CLI (options, error messages, logging, etc.)
Operating System
NA
Description
TODO

https://meltano.slack.com/archives/C069CQNHDNF/p1726653099077779
https://meltano.slack.com/archives/C0695LLCGVC/p1726488890814789

Code
No response
Link to Slack/Linen
https://meltano.slack.com/archives/C069CQNHDNF/p1726653099077779

Closed by https://github.com/meltano/meltano/pull/8785


module statistics has no attribute mean

Bug description
When updating to the new PyTorch-lightning version 2.3.3 and using the MlFlowLogger as logger arg in the trainer I‘m getting the error trace (see error section)
What version are you seeing the problem on?
master
How to reproduce the bug
No response
Error messages and logs
train.py 9 <module>
import mlflow.pytorch

__init__.py 1190 <module>
from mlflow.pytorch._lightning_autolog import MlflowModelCheckpointCallback  # noqa: F401

_lightning_autolog.py 24 <module>
import pytorch_lightning as pl

__init__.py 27 <module>
from pytorch_lightning.callbacks import Callback  # noqa: E402

__init__.py 29 <module>
from pytorch_lightning.callbacks.pruning import ModelPruning

pruning.py 32 <module>
from pytorch_lightning.core.module import LightningModule

__init__.py 16 <module>
from pytorch_lightning.core.module import LightningModule

module.py 62 <module>
from pytorch_lightning.loggers import Logger

__init__.py 14 <module>
from pytorch_lightning.loggers.comet import CometLogger

comet.py 30 <module>
from pytorch_lightning.loggers.logger import Logger, rank_zero_experiment

logger.py 103 <module>
default_func: Callable[[Sequence[float]], float] = statistics.mean,

AttributeError:
module 'statistics' has no attribute 'mean'

Environment

Current environment
#- PyTorch Lightning Version (e.g., 1.5.0): 2.3.3
#- PyTorch Version (e.g., 2.0): 2.3.1
#- Python version (e.g., 3.9): 3.11
#- OS (e.g., Linux): MacOS Sonoma 14.5
#- CUDA/cuDNN version:
#- GPU models and configuration:
#- How you installed Lightning(`conda`, `pip`, source): pip

More info
No response

Hey @FabianKuon
The statistics module is a standard module in Python and it definitely has a mean function. Could you please check that you don't have a different statistics module in the python path? For example, if you have a statistics.py module in your code, it would cause a collision with the standard library package. In this case, please rename or delete it.

@awaelchli thank you very much for your quick response. You‘re right I do have a statistics.py file in my repo. Renaming that solved the issue.
Once again thank you very much

Perfect!


Parse and set --mcpu in onnx-mlir-opt command

--maccel needs --mcpu to know it is z16 or not, so this patch parses and sets --mcpu in the onnx-mlir-opt command. Otherwise, we will see a warning Warning: No NNPA code is generated because --mcpu is not set or < z16. when running onnx-mlir-opt for NNPA.

@jenkins-droid test this please

Jenkins Linux amd64 Build #13337 [push] Parse and set --mcpu in ... started at 08:29

Jenkins Linux ppc64le Build #12357 [push] Parse and set --mcpu in ... started at 09:38

Jenkins Linux s390x Build #13363 [push] Parse and set --mcpu in ... started at 09:29

Jenkins Linux amd64 Build #13337 [push] Parse and set --mcpu in ... passed after 1 hr 27 min

Jenkins Linux s390x Build #13363 [push] Parse and set --mcpu in ... passed after 1 hr 59 min

Jenkins Linux ppc64le Build #12357 [push] Parse and set --mcpu in ... passed after 2 hr 0 min


Clean logs and screenshots

Hi all,
I am using a script to delete logs and screenshots after a month. It will be nice to achieve that in opentest.

I included this feature in the backlog. This should provide the user with the option to clean-up test session information (including logs and screenshots) based on session age and number of sessions recorded.


Testcontainers hanging when using docker-compose on GitHub actions

Hi There. I came here from https://github.com/testcontainers/testcontainers-scala/issues/129.
I don't know why the o.testcontainers.DockerClientFactory class tries to download 12GB. The test ends due to lack of memory.
14:16:54.521 WARN  [pool-13-thread-5    ] o.t.c.DockerComposeContainer         Unable to pre-fetch an image (localstack/localstack) depended upon by Docker Compose build - startup will continue but may fail. Exception message was: Could not pull image: write /var/lib/docker/tmp/GetImageBlob417295136: no space left on device

I have tested by manually launching the docker-compose command and everything works correctly. Here you can see the result.
https://github.com/mvillafuertem/testcontainers-scala/runs/997305748?check_suite_focus=true
Thanks

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe this is a mistake, please reply to this comment to keep it open. If there isn't one already, a PR to fix or at least reproduce the problem in a test case will always help us get back on track to tackle this.

Hi, Any hint?

it works with testcontainers-scala-core 0.39.0


Add pipeline input

As discussed in issue #51. I've added tests to the last Compare-Equivalent describe block. The entire test suite ran successfully locally beforehand and after the changes. The tests are really basic though, feel free to suggest or apply changes.
Fixes #51

FYI: @ronaldborman  using Fixes #, makes the PR close the issue when it is merged, and also makes it easier to find out which issue was closed by which PR.
See it documented here:  https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword


Random failures of tests on Expecta prerequisite block

There are implicit ptr to BOOL casts in prerequisite blocks of FBSnapshotTest matcher. There is some chance that implicit BOOL cast will return NO for non nil pointers - in case of zero values of 8 lower bits of a pointer.

Would love a spec + fix, thanks.

Looks like it depends on the tests executing runtime/architecture. I use pre x86-64 simulator (iPad Retina actually) to run my tests within a CI process so BOOL is defined as a signed char. Don't know if it's a valid requirement to run on such simulator devices. Spec for this is going to be a little bit scary with manual malloc/free to get the properly aligned UIView ptr.

Thanks! closed by #43


Create front end pages

First try on Vercel

login page
main page
budget page

Please move to https://github.com/ece496-BEAN/bean-client


Error during npm run setup

I was able to clone, install, and setup successfully once, but now I receive the below error after running these commands:
git clone https://github.com/thebakeryio/baker.git MyApp
cd MyApp && npm install && npm run setup

baker run ./.baker/generate.js app
module.js:471
throw err;
^
Error: Cannot find module './src/init'
at Function.Module._resolveFilename (module.js:469:15)
at Function.Module._load (module.js:417:25)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)

Cloned and re-ran the install/setup commands this morning and it is working now...closing issue.


Added animation toggle option

Hi, I added a toggle option in the config file which toggles whether the fading animations (enabled by default) should be applied on the home page or not.
How it works: I changed index.css so that the animation properties are only applied to elements that also have the class .animate. Then in the template files, I conditionally applied the .animate class to the animated elements only if the config option is enabled. Also, I set the social media icons to have display: block by default if the animate option is disabled, so there is no delay before they appear.

Thanks @NishantTharani


Collection of Solarbank 2 system exports

Please provide your solarbank 2 system export examples here.
You can extract all data with the system_export tool and zip the output files.
You can add a text file to the zip containing info about some specifics when the export was taken, for example the components of your setup.
Before you provide an export, make sure that the solarbank_info structure in api_sites.json does show:
      "is_display_data": true,
and not
      "is_display_data": false,
The power values in the site scene_info response are wrong when is_display_data is false. This field seems to be an indicator to the app to skip the display of the response and delay home screen update until next refresh.
The reason and work around for this problem is not understood yet and is to be documented in issue #114

I just packaged two exports and a system description
dev2024063019.zip
Something I wonder about. Is it possible that the extension battery is not yet visible? The app shows both but in the api there is only 1600 Wh.

Here's my export, I have the same setup as @stephan-l (meaning, one Solarbank 2 E1600Pro, one battery expansion and one smart meter).
nicolinux.zip
Let me know if you need more.

I made another export especially for reference in the status thread:
dev2024070113.zip

Here's my export, I have the same setup as @stephan-l (meaning, one Solarbank 2 E1600Pro, one battery expansion and one smart meter).
nicolinux.zip
Let me know if you need more.

Thanks for the data. The export looks like being done with the shared account, since many responses have no data.
In general, when providing exports to get a full picture of what is possible with the devices, you need to run the export tool with the main account.

Thanks for the data. The export looks like being done with the shared account, since many responses have no data.

Indeed, I thought it was already useful that way, but for science™, I can do another export using my main Anker account.

Something I wonder about. Is it possible that the extension battery is not yet visible? The app shows both but in the api there is only 1600 Wh.

It was visible, but not properly considered for the cap and energy calculation of the battery. This is fixed now, also update the solarbank monitor and export tool based  on recent data.
Pls use the latest versions before doing another export.

I made a full dump with the owner account.
The system was running at 140W of battery. 0 from grid and solar.
ste20240701222735.zip

@stephan-l thanks for the new dump. That looks much more useful. First observations:

OTA update info is not working anymore. It was working for Solarbank 1, not sure what the issue is to query a flag whether a firmware update is available
get_upgrade_record for the site is empty. I'm pretty sure everybody does firmware upgrades after setup. But maybe they are not reported by the site report if done prior adding the devices to the site. This is no problem since not used in the Api cache data
new Energy statistics: I need to review them and compare to understand which of the values is returned only as total for the queries interval. Those queries have to be repeated to get specific total statistics for previous day. Maybe the mechanism to query daily statistics for today and yesterday must be changed and optimized to reduce the min. required Api requests.
Solarbank 2 device load schedule: There is non defined yet. We need exports of various Solarbank 2 schedule definitions. Even if they are not used with AI mode, they can probably be defined and will be included in exports. We need examples of which parameters/fields can be available in the new schedules and how the various weekday configuration structure will be used in the schedule structure. This is most likely pretty much different to Solarbank 1
device_attrs does not show any data. More testing and exploration of possible/required json parameters for those endpoints is required. see #107. We need to understand which devices are supported by this endpoint and what can be changed with the set_device_attrs endpoint (and how)
Scene Info is already prepared for a smart_plug device list structure, which is coming probably later this year. So smart plugs may be additional devices to be added to Api caches
The Solarbank data time stamp is now always valid even if the data itself seems to be valid. This is strange, since my assumption was that correct cloud update time is presented typically when data is valid. So this timestamp cannot really be used to understand how often data is sent to the cloud by Solarbank 2?

Here is an actual extract of owner data from export in the monitor after I implemented another workaround for a missing field value in scene_info for the smartmeter wireless_type. I assume now this to be 1 if there is only 1 network in the list for the site and smartmeter reports an online wifi state. In that case it must be using the same network (don't want to make assumptions for anything else, since there could also be smartmeters without solarbank in a site).
Solarbank Monitor (refresh 60 s, details refresh 600 s):
Using input source folder: /workspaces/core/anker-solix-api/exports/SB2onwer_1
Sites: 1,  Devices: 2
--------------------------------------------------------------------------------
Device         : Solarbank 2 E1600 Pro   Alias         : Solarbank 2 E1600 Pro
Serialnumber   : OY7WE1AOZVGS1RLX        Admin         : YES
Site ID        : 38cac050-0128-0eff-c9ba-61dabb1f3df1
Wifi SSID      : wifi-network-1
Wifi state     : Online                  Signal        :   92 %
SW Version     : v<IP_ADDRESS>                Auto-Upgrade  : Disabled
Cloud-Updated  : 1970-01-01 00:00:00     Valid Data    : YES (Requeries: 0)
Cloud Status   : online                  Status code   : 1
Charge Status  : detection               Status code   : 0
State Of Charge:   44 %                  Min SOC       :   10 %
Battery Energy : 1408 Wh                 Capacity      : 3200 Wh
Exp. Batteries :    1 Pcs                AC socket     :    0 W
Solar Power    :    0 W                  Output Power  :  140 W
Solar Ch_1     :    0 W                  Solar Ch_2    :    0 W
Solar Ch_3     :    0 W                  Solar Ch_4    :    0 W
Charge Power   : -140 W                  Device Preset :  200 W
Schedule  (Now): 19:28:58 UTC +0200      System Preset :  200 W
ID Start End   Export Output ChargePrio    SB1    SB2  Mode Name
--------------------------------------------------------------------------------
Device         : Smart Meter             Alias         : Smart Meter
Serialnumber   : FYGDVE1ZXEJ6OJAM        Admin         : YES
Site ID        : 38cac050-0128-0eff-c9ba-61dabb1f3df1
Wifi SSID      : wifi-network-1
Wifi state     : Online                  Signal        :   92 %
SW Version     : v<IP_ADDRESS>               Auto-Upgrade  : Unknown
Cloud Status   : online                  Status code   : 1
Grid Status    : ok                      Status code   : 0
Grid Import    :    0 W                  Grid Export   :    0 W
--------------------------------------------------------------------------------

Since both Grid values were 0W, it is difficult to relate them to the new "to_home_load": "140" field which was showing 140 W.
I assume that could actually be the calculated home consumption value, but would need to be proven with other snapshots showing values for more fields. So an export while little Solar power is coming in, there is bypass to the house + discharge from battery + grid is not showing 0 W would be good to correlate all power fields properly.
Please also observe grid_status code, I haven't seen anything else than 0 yet, now describing this as OK state for the grid. I would assume there is another code on power outage, maybe others too ?

Grid status for a power outage will be difficult to obtain. the smart meter is powered by the voltage sensing ports. so it will go offline on power loss. any idea what I shall test next week when I am onsite next time?
I gave it a new try (full dump:  ste202407022222303.zip )
Solarbank Monitor (refresh 30 s, details refresh 300 s):
Sites: 1,  Devices: 2
--------------------------------------------------------------------------------
Device         : Solarbank 2 E1600 Pro   Alias         : Solarbank 2 E1600 Pro
Serialnumber   : APCGQ80Exxxx        Admin         : YES
Site ID        : 99e
Wifi SSID      : xxx
Wifi state     : Online                  Signal        :   90 %
SW Version     : v<IP_ADDRESS>                Auto-Upgrade  : Disabled
Cloud-Updated  : 2024-07-02 22:23:03     Valid Data    : YES (Requeries: 3)
Cloud Status   : online                  Status code   : 1
Charge Status  : detection               Status code   : 0
State Of Charge:   64 %                  Min SOC       :   10 %
Battery Energy : 1024 Wh                 Capacity      : 1600 Wh
Exp. Batteries :    1 Pcs                AC socket     :    0 W
Solar Power    :    0 W                  Output Power  :    0 W
Solar Ch_1     :    0 W                  Solar Ch_2    :    0 W
Solar Ch_3     :    0 W                  Solar Ch_4    :    0 W
Charge Power   :    0 W                  Device Preset :  200 W
Schedule  (Now): 22:22:50 UTC +0200      System Preset :  200 W
ID Start End   Export Output ChargePrio    SB1    SB2  Mode Name
--------------------------------------------------------------------------------
Device         : Smart Meter             Alias         : Smart Meter
Serialnumber   : AUJS020xxxx        Admin         : YES
Site ID        : 99e3a
Wifi SSID      : xxx
Wifi state     : Online                  Signal        :   90 %
SW Version     : v<IP_ADDRESS>               Auto-Upgrade  : Unknown
Cloud Status   : online                  Status code   : 1
Grid Status    : ok                      Status code   : 0
Grid Import    :  132 W                  Grid Export   :    0 W
--------------------------------------------------------------------------------

My grid meter was at approx 140W. So input is right.
Also the Capacity is broken again. Before todays git pull it was 3200Wh for my setup:
Cloud-Updated  : 2024-07-02 21:57:12     Valid Data    : YES (Requeries: 0)
Cloud Status   : online                  Status code   : 1
Charge Status  : detection               Status code   : 0
State Of Charge:   65 %                  Min SOC       :   10 %
Battery Energy : 2080 Wh                 Capacity      : 3200 Wh
Exp. Batteries :    1 Pcs                AC socket     :    0 W

Somehow the battery is charged but now output to the home. I need to understand when it is charged by solar power. Today there wasn't any output only charging.

After another try I got the correct capacity again. Kind of confusing.
Wifi state     : Online                  Signal        :   88 %
SW Version     : v<IP_ADDRESS>                Auto-Upgrade  : Disabled
Cloud-Updated  : 2024-07-02 23:04:22     Valid Data    : YES (Requeries: 0)
Cloud Status   : online                  Status code   : 1
Charge Status  : detection               Status code   : 0
State Of Charge:   64 %                  Min SOC       :   10 %
Battery Energy : 2048 Wh                 Capacity      : 3200 Wh
Exp. Batteries :    1 Pcs                AC socket     :    0 W

Over the last ~23 hours I have collected some data every 15min via cron, see attachment. Unfortunately most of them are with "is_display_data"="false". I have attached my interpretation of the values in a screenshot of the Anker app.
solix.zip

I made a full dump with the owner account. The system was running at 140W of battery. 0 from grid and solar. ste20240701222735.zip

@stephan-l thanks for the many extracts, they help to get a better picture on various situations after sorting out the invalid data extracts.
One situation puzzles me however to correlate the values properly:
    "solarbank_info": {
      "solarbank_list": [
        {
          "device_pn": "A17C1",
          "device_sn": "VKYPTREWMTYU48Q5",
          "device_name": "Solarbank 2 E1600 Pro",
          "device_img": "https://public-aiot-fra-prod.s3.dualstack.eu-central-1.amazonaws.com/anker-power/public/product/2024/05/24/iot-admin/5iJoq1dk63i47HuR/picl_A17C1_normal%281%29.png",
          "battery_power": "10",
          "bind_site_status": "",
          "charging_power": "0",
          "power_unit": "W",
          "charging_status": "6",
          "status": "1",
          "wireless_type": "1",
          "main_version": "",
          "photovoltaic_power": "0",
          "output_power": "0",
          "create_time":<PHONE_NUMBER>,
          "set_load_power": "",
          "sub_package_num": 0,
          "output_cutoff_data": 10,
          "is_display": true
        }
      ],
      "total_charging_power": "0",
      "power_unit": "W",
      "charging_status": "0",
      "total_battery_power": "0.10",
      "updated_time": "2024-07-02 21:14:53",
      "total_photovoltaic_power": "0",
      "total_output_power": "0.00",
      "display_set_power": false,
      "battery_discharge_power": "0",
      "ac_power": "0",
      "to_home_load": "0",
      "is_display_data": true,
      "solar_power_1": "0",
      "solar_power_2": "1",
      "solar_power_3": "1",
      "solar_power_4": "1"
    },
    "retain_load": "200W",
    "scene_mode": 1,
    "home_load_power": "0",
    "updated_time": "01-01-0001 00:00:00",
    "power_site_type": 5,
    "site_id": "5e6f13ae-93f7-83bf-d119-b41c4bdc41ba",
    "powerpanel_list": [],
    "grid_info": {
      "grid_list": [
        {
          "device_pn": "A17X7",
          "device_sn": "HVCNROR98JH6W3SG",
          "device_name": "Smart Meter",
          "device_img": "",
          "create_time":<PHONE_NUMBER>,
          "status": "1",
          "bind_site_status": "",
          "wireless_type": ""
        }
      ],
      "photovoltaic_to_grid_power": "0",
      "grid_to_home_power": "423",
      "grid_status": 0,
      "has_history_data": true
    },
Generated Solar power is 3 W from all, but this is not reflected somehow in any of the other fields.
grid_to_home_power is 423 W (ok that is the grid import)
The solarbank charging_status = 6 which probably means full_bypass (as for Solarbank 1)
Soc is 10% in the evening at 21:00. Seems weird, but explains the full bypass with 3 W remaining Solar power.
"charging_power": "0", => Nothing is loaded to empty battery, another indication that it is doing full bypass and BMS is not actively used.
"output_power": "0", => Weird, where are the 3W Solar power gone? Maybe output_power not provided when doing full bypass without active BMS?

How is the display in the App in the morning with little solar power and empty battery when this full bypass mode is used without charge and discharge? Is the solar power reflected somewhere else in the figures going to home?

@stephan-l  Following is another weird situation making it difficult to correlate the values accurately. It appears the individual fields are not used consistently as with Solarbank 1, which makes it pretty difficult to extract the properly for correct monitoring. I build some work arounds for such fields, where e.g. the SB totals do not match the usage of individual solarbank device fields. But I'm reluctant to break anything with those workarounds for anything that does not match with Solarbank 2 reporting.
    "solarbank_info": {
      "solarbank_list": [
        {
          "device_pn": "A17C1",
          "device_sn": "YL5C48EDP7UZ108S",
          "device_name": "Solarbank 2 E1600 Pro",
          "device_img": "https://public-aiot-fra-prod.s3.dualstack.eu-central-1.amazonaws.com/anker-power/public/product/2024/05/24/iot-admin/5iJoq1dk63i47HuR/picl_A17C1_normal%281%29.png",
          "battery_power": "15",
          "bind_site_status": "",
          "charging_power": "800",
          "power_unit": "W",
          "charging_status": "1",
          "status": "1",
          "wireless_type": "1",
          "main_version": "",
          "photovoltaic_power": "597",
          "output_power": "800",
          "create_time":<PHONE_NUMBER>,
          "set_load_power": "",
          "sub_package_num": 0,
          "output_cutoff_data": 10,
          "is_display": true
        }
      ],
      "total_charging_power": "0",
      "power_unit": "W",
      "charging_status": "0",
      "total_battery_power": "0.15",
      "updated_time": "2024-07-02 08:30:13",
      "total_photovoltaic_power": "597",
      "total_output_power": "800.00",
      "display_set_power": false,
      "battery_discharge_power": "203",
      "ac_power": "20",
      "to_home_load": "780",
      "is_display_data": true,
      "solar_power_1": "210",
      "solar_power_2": "206",
      "solar_power_3": "87",
      "solar_power_4": "94"
    },
    "retain_load": "200W",
    "scene_mode": 1,
    "home_load_power": "2419",
    "updated_time": "01-01-0001 00:00:00",
    "power_site_type": 5,
    "site_id": "9a7e3ee0-c6d7-67c0-d1bf-3ea08747bcea",
    "powerpanel_list": [],
    "grid_info": {
      "grid_list": [
        {
          "device_pn": "A17X7",
          "device_sn": "PQP04MMR9VCGO3DG",
          "device_name": "Smart Meter",
          "device_img": "",
          "create_time":<PHONE_NUMBER>,
          "status": "1",
          "bind_site_status": "",
          "wireless_type": ""
        }
      ],
      "photovoltaic_to_grid_power": "0",
      "grid_to_home_power": "1619",
      "grid_status": 0,
      "has_history_data": true
    },

For example the Api reports for device:
"battery_power": "15",  => SOC
"charging_power": "800", => Api does not provide correct value here, this is typically 0 or output power, therefore I built in a work around for the Api site cache structure. This work around also uses negative values for discharge power, which is taken from the SB total_discharge_power (seems to be the only trustable field, but shows discharge of all solarbanks only). Therefore this vlue must also be adjusted to multiple solarbank setups based on their output_power percentage of the reported total_output_power. Its complicated, but the only way to get reliable charge and discharge values per Solarbank 1 device.
"charging_status": "1", => This is Bypass for Solarbank 1 (neither charge nor discharge), looks to be the similar for SB2, but here bypass can mean also adding discharge power, a mode that is not supported by Solarbank 1. I think that can be distinguished with a pseudo code and dedicated description for bypass_discharge
"output_power": "800", => Valid Max demand as requested from smartmeter upon high house consumption of 2419 W
SB totals:
"total_photovoltaic_power": "597", => OK, sum of all solar channels
"total_output_power": "800.00", => OK, same as device output power
"battery_discharge_power": "203",  => Only valid discharge value provided. This will be taken by the library to put -203 W into the invalid 'charging_power' field of a solarbank device.
"ac_power": "20",  => Why are there 20 W on the AC socket? Is there anything connected that draws AC socket power?
"to_home_load": "780", => That means from 800 W output, 20 W go to the AC socket (true?) and 780 W into house?
Grid total:
"photovoltaic_to_grid_power": "0", => OK, no grid export at this time
"grid_to_home_power": "1619", => OK, required import for high house consumption. Assuming this is valid as reported from smartmeter, then we have 2419 -1619 = 800 W. And here is the big questionmark: Since we have only 780 W to the house, where are the 20 W? Reported incorrectly to the AC power, which is not used (to be confirmed)? Or if the 20 W AC power correct, then the house consumption value is calculated incorrectly by the appliance and 20 W too high (since it does not consider the AC output in the calculation and using total_output_power instead of to_home_load)?
"grid_status": 0,
Site total:
"home_load_power": "2419", => Questionable value as per previous comments...

After another try I got the correct capacity again. Kind of confusing.
Wifi state     : Online                  Signal        :   88 %
SW Version     : v<IP_ADDRESS>                Auto-Upgrade  : Disabled
Cloud-Updated  : 2024-07-02 23:04:22     Valid Data    : YES (Requeries: 0)
Cloud Status   : online                  Status code   : 1
Charge Status  : detection               Status code   : 0
State Of Charge:   64 %                  Min SOC       :   10 %
Battery Energy : 2048 Wh                 Capacity      : 3200 Wh
Exp. Batteries :    1 Pcs                AC socket     :    0 W

This might be related to the capacity and energy calculation. If the initial response is invalid, the battery packs are 0 too, Maybe the calculations are not refreshed properly afterwards. The code also needs to make sure, that re-calculation is not done when the response contains invalid data, so it must cover both special cases:

initially invalid but calculated fields must be generated (potentially with a value), otherwise HA integration would not generate entities.
updates must ignore re-calculation with invalid data

I think I will do some measurements onsite next week to verify the theses. I can monitore questionable values and test different scenarios then.

Can someone explain this situation?
I don't remember who provided the T2 system export... There is home demand and import from grid, but SB2 is not delivering in the evening even if SOC is 64%
Can home delivery be disabled somehow or why is there no discharge?
--------------------------------------------------------------------------------
Device         : Solarbank 2 E1600 Pro   Alias         : Solarbank 2 E1600 Pro
Serialnumber   : IDT679D215D635EA        Admin         : YES
System         : T2  (Site ID: c316e3a9-befc-47c9-a8bf-c211dd37d31b)
Wifi SSID      : wifi-network-1
Wifi state     : Online                  Signal        :   90 %
SW Version     : v<IP_ADDRESS>                Auto-Upgrade  : Disabled
Cloud-Updated  : 2024-07-02 22:23:03     Valid Data    : YES (Requeries: 0)
Cloud Status   : online                  Status code   : 1
Charge Status  : detection               Status code   : 0
State Of Charge:   64 %                  Min SOC       :   10 %
Battery Energy : 2048 Wh                 Capacity      : 3200 Wh
Exp. Batteries :    1 Pcs                AC socket     :    0 W
Solar Power    :    0 W                  Output Power  :    0 W
Solar Ch_1     :    0 W                  Solar Ch_2    :    0 W
Solar Ch_3     :    0 W                  Solar Ch_4    :    0 W
Charge Power   :    0 W                  Device Preset :  200 W
Home Demand    :  132 W                  SB Home Load  :    0 W  (-)
Schedule  (Now): 07:19:51 UTC +0200      System Preset :  200 W
ID Start End   Export Output ChargePrio    SB1    SB2  Mode Name
--------------------------------------------------------------------------------
Device         : Smart Meter             Alias         : Smart Meter
Serialnumber   : 9Q4CSMNJLAPJORP7        Admin         : YES
System         : T2  (Site ID: c316e3a9-befc-47c9-a8bf-c211dd37d31b)
Wifi SSID      : wifi-network-1
Wifi state     : Online                  Signal        :   90 %
SW Version     : v<IP_ADDRESS>               Auto-Upgrade  : Unknown
Cloud Status   : online                  Status code   : 1
Grid Status    : ok                      Status code   : 0
Grid Import    :  132 W                  Grid Export   :    0 W
--------------------------------------------------------------------------------

Here is another interesting example, showing kind of charge_priority in the morning even if in detection mode, since SOC is just at 7%. I don't think this should get a different pseudo state since it is charging code 0, and all kind of charging states typically have 3.
But clearly it shows that demand is higher than solar and even then not all is bypassed to home to 'enforce' charging of low battery.
--------------------------------------------------------------------------------
Device         : NoName                  Alias         : Solarbank 2 E1600 Pro
Serialnumber   : AXKI2U6VS8IQ7NZS        Admin         : NO
System         : Maison  (Site ID: adb7f7c0-c8c0-dcdc-ebc6-6e0a7a7b3ec1)
Wifi SSID      :
Wifi state     : Unknown                 Signal        :  --- %
SW Version     : Unknown                 Auto-Upgrade  : Unknown
Cloud-Updated  : 1970-01-01 00:00:00     Valid Data    : YES (Requeries: 0)
Cloud Status   : online                  Status code   : 1
Charge Status  : detection               Status code   : 0
State Of Charge:    7 %                  Min SOC       :    5 %
Battery Energy :  224 Wh                 Capacity      : 3200 Wh
Exp. Batteries :    1 Pcs                AC socket     :    0 W
Solar Power    :  573 W                  Output Power  :  467 W
Solar Ch_1     :  144 W                  Solar Ch_2    :  141 W
Solar Ch_3     :  147 W                  Solar Ch_4    :  141 W
Charge Power   :  106 W                  Device Preset :    0 W
Home Demand    :  624 W                  SB Home Load  :  467 W  (-)
--------------------------------------------------------------------------------
Device         : NoName                  Alias         : Smart Meter
Serialnumber   : 3SJSUU0Z3W0VXQKZ        Admin         : NO
System         : Maison  (Site ID: adb7f7c0-c8c0-dcdc-ebc6-6e0a7a7b3ec1)
Wifi SSID      :
Wifi state     : Unknown                 Signal        :  --- %
SW Version     : Unknown                 Auto-Upgrade  : Unknown
Cloud Status   : online                  Status code   : 1
Grid Status    : ok                      Status code   : 0
Grid Import    :  157 W                  Grid Export   :    0 W
--------------------------------------------------------------------------------

OK, so just a firmware flaw, nothing to be considered for the field interpretation.

I updated the api with new charging states and the monitor accordingly. #104
I also added the new house demand and SB_home_load fields to the monitor. This is what is new on the SB2 systems in the home screen of the app.
The house demand ("Zuhause") is a new system field (home_load_power) and the SB home load is a solarbank devices total field (to_home_load). The house demand does not reflect the house consumption all the time. When the solarbank is on standby, it is 0. So it must not be confused with a value that can be used for permanent house consumption.
The former SB output total refers to all power that is going out from the solarbanks. The new SB to home load is the same, but subtracted by the AC socket power. So for SB2, only the new field is reflecting what is going into the house.
The smartmeter values seem to provide also data when SB2 is in standby.
However, someone needs to confirm with the monitor whether the smartmeter values are valid when the SB data is invalid. Right now I consider them invalid too, but they are 0W most of the time also with valid SB data, so it is difficult to recognise that in a snapshot.

One more note to make here:

The new SB to_home_load field is not used by Solarbank 1 (always 0). In fact I think it reflects the AC power from the inverter that goes into the house, so it is SB output power (used by SB1 and SB2) - AC power field which is likely the AC socket.
That means without Socket (SB2 Plus and later SB2) should always reflect same values for old SB output power and new to_home_load fields.
The system power field home_load_power is the AC power house demand for the solarbank. This is the consumption of the house, while the Solarbank is ON, when the demand seems to reflect 0 W. I assume that is the value used as target for the Solarbank regulation
All power values sum up to same totals typically including the solar power channels. That means they cannot be real, since AC and DC power is mixed an no inverter efficiency loss is factored into the values. I assume the DC power values which cannot be really proven (solar, Battery etc) are adoped / decreased? to match the AC power values used for smartmeter/grid and house.
The AC power values could be easily compared with other metering tools, but I understood they seem to be pretty accurate. Therefore I believe the power values would need to be 5-10% higher in reality to consider inverter loss etc. So tracking the DC values for energy measurements is likely providing optimized measurements in terms of efficiency for the solarbank 2 when comparing them with the energy output to the house...

@nicolinuxfr , @stephan-l , @tagauch1 can anyone assist with the other open issues to continue work on remaining SB2 support implementation?:

#106
#107
#108
#109
#116

Sorry, my knowledge is too limited to really help. I can do more exports, but I'm not sure it's useful ? Here's one I just did using my admin account this time :
nicolinux.zip

I'll try to help as much as possible but my system is installed in a remote location so I need to drive there for physical tests.

Sorry, my knowledge is too limited to really help. I can do more exports, but I'm not sure it's useful ? Here's one I just did using my admin account this time :
nicolinux.zip

Would already help to define various schedules and export then to see various interval setting and weekday settings.

@nicolinuxfr I have seen you have already a basic schedule defined.
Can you let me know which options can be defined in SB2 schedule intervals?
Please also create some additional intervals and different schedules for a subset of weekdays, we need to see how the schedule structure will change then and whether there come new fields with the SB2 intervals....

PS: The new api version has been refactored to have smaller files in the library. I separated also all type definitions of the Api, therefore I also renamed _API_ENDPOINTS to API_ENDPOINTS to avoid code checker warnings for accessing internal variables.
In case you used them in you test modules, you have to rename them.
I also added the energy exports for each PV channel in the Api and the solarbank monitor.
However, I have not seen their structure yet, so could be that the display in the monitor is not working yet, in case the structure is different than for other energy stats.
A new system_export with the additional solar production energy files per PV channel will be usefull to verify their structure.

Yes, only one to stop the system to send electricity during the night, when I have off-peak prices.

Can you let me know which options can be defined in SB2 schedule intervals?

Here are some screenshots from the app, I can't export more systems right now. If I understand what you need, I should create more complex schedules and then ask for an export for each variation ?

OK, so not much parameters in the App, but the same as for SB1 are still in the schedule structure.
What is new however are the weekdays. Pls create intervals for subset of weekdays and export the system again with the main account using the latest api version and export tool.
This will also give an example of the PV1-4 energy stats queries that I added.

Here is an export after setting this schedule inside the app :
schedule.zip

Let me know if you need a different setup next.

@nicolinuxfr
Thanks, just figured out that the current request parameter cannot be used to get SB2 schedule formats.
See #109
I need to adopt the system export tool to use also dev_parm=6 in the collection, that should provide the correct format of the schedule. Seems the set and get device_load endpoints are not suitable for SB2 at all....

@nicolinuxfr
I updated the system export to get now device parm for type 4 & 6, so should now extract the new schedule structure.
I assume the user mode setting could be part of the schedule structure although it appears as separate setting in the App.
So please extract with user mode active as well as with AI mode active to see whether the schedule structure is different between the 2 exports.
Thanks

@thomluther here you go ! (automatic for AI mode, Manuel for a schedule)
automatic.zip
manuel.zip

@nicolinuxfr Please see my update in the schedule structure issue.
If you can validate the changes in the monitor and comment/confirm the questions that would be great.

@stephan-l @tagauch1
If you have a smartmeter installed, please see update in the schedule structure issue.
Would be helpfull if you can confirm that Api schedule extraction now works and is displayed correctly in the monitor.
You need to run the monitor with the main account to see the schedule. Please also run it with energy stats and validate the the extracted numbers for today and yesterday reflect all daily stats that you can find in the App. I added also the stats for each PV channel. Don't know if there are more in the app.
PS: For the energy stats, you can run the monitor with the shared account and compare with the App values using the main account there.

I tried it and it looks legit:
Running site refresh...
Running device details refresh...
Running energy details refresh...
Solarbank Monitor (refresh 30 s, details refresh 300 s):
Sites: 1,  Devices: 2
--------------------------------------------------------------------------------
Device         : Solarbank 2 E1600 Pro   Alias         : Solarbank 2 E1600 Pro
Serialnumber   : AP        Admin         : YES
System         : T2  (Site ID: 99e3)
Wifi SSID      : xxxx
Wifi state     : Online                  Signal        :   90 %
SW Version     : v<IP_ADDRESS>                Auto-Upgrade  : Disabled
Cloud-Updated  : 1970-01-01 00:00:00     Valid Data    : YES (Requeries: 0)
Cloud Status   : online                  Status code   : 1
Charge Status  : detection               Status code   : 0
State Of Charge:   73 %                  Min SOC       :   10 %
Battery Energy : 2336 Wh                 Capacity      : 3200 Wh
Exp. Batteries :    1 Pcs                AC socket     :    0 W
Solar Power    :    0 W                  Output Power  :  138 W
Solar Ch_1     :    0 W                  Solar Ch_2    :    0 W
Solar Ch_3     :    0 W                  Solar Ch_4    :    0 W
Charge Power   : -138 W                  Device Preset :  200 W
Home Demand    :  138 W                  SB Home Load  :  138 W
Schedule  (Now): 21:50:38 UTC +0200      System Preset :  200 W
Usage Mode     : Automatic (1)           Sched. Preset :  200 W
ID Start End   Output Weekdays
--------------------------------------------------------------------------------
Device         : Smart Meter             Alias         : Smart Meter
Serialnumber   : AUJ        Admin         : YES
System         : T2  (Site ID: 99e3)
Wifi SSID      : xxx
Wifi state     : Online                  Signal        :   90 %
SW Version     : v<IP_ADDRESS>               Auto-Upgrade  : Unknown
Cloud Status   : online                  Status code   : 1
Grid Status    : ok                      Status code   : 0
Grid Import    :    0 W                  Grid Export   :    0 W
--------------------------------------------------------------------------------
Energy details for System T2 (Site ID: 99e3):
Today          : 2024-07-15              Yesterday     : 2024-07-14
Solar Energy   :  4.94 kWh               Solar Energy  :  4.58 kWh
Solar Ch 1/2   :  2.47 / 2.47 kWh        Solar Ch 1/2  :  2.29 / 2.29 kWh
Solar Ch 3/4   :  0.00 / 0.00 kWh        Solar Ch 3/4  :  0.00 / 0.00 kWh
SB Charged     :  3.07 kWh               SB Charged    :  2.40 kWh
SB Discharged  :  1.43 kWh               SB Discharged :  1.24 kWh
House Feed     :  1.41 kWh               House Feed    :  1.23 kWh
House Usage    :  3.39 kWh               House Usage   : 16.17 kWh
Grid Import    :  0.12 kWh               Grid Import   : 12.77 kWh
Grid Export    :  0.02 kWh               Grid Export   :  0.01 kWh
AC Socket      :  0.00 kWh               AC Socket     :  0.00 kWh
Smartplugs     :  0.00 kWh               Smartplugs    :  0.00 kWh
Sol/Bat/Gri %  :  38/ 62/  0 %           Sol/Bat/Gri % :  48/ 52/  0 %
--------------------------------------------------------------------------------

Statistics look fine and the state of charge is the average of my internal and external battery.
Latest export:
ste20240715215000.zip

Hello
Can someone provide me an actual export as owner account when NO schedule is defined (everything cleared in your schedule settings). Please upload this to #108 to discuss follow on activities there.
I need to see what the minimal schedule structure looks like and if that is something to be usable as template for composing a minimal response to change any schedule related settings (usage mode or actual output preset).
Once I know the minimal structure, I will provide examples of possible structures to apply a change, and someone need to verify them what works and what won't work.
The helper method required for the SB2 schedule need to be able to modify a single setting also when no schedule is defined yet.
For the usage mode this will be simple, since it is not tight to the schedule itself. But for the output preset, a rate plan and a range interval will have to be created from scratch if none exists for actual time. Will have to think how to deal with different days in that case since some could already be defined and just a range for an actual time gap needs to be created to apply the actual output preset.

@stephan-l did you use the latest release of the export tool?
Your output does not contain the OTA file without SN...

@stephan-l did you use the latest release of the export tool? Your output does not contain the OTA file without SN...

Yes it is the current main branch.
Just tried again:
Saved JSON to file /Users/sl/PycharmProjects/anker-solix-api/./exports/ste20240729190900/device_fittings_X9K0XWK8P04DRHR9.json Exporting load... (10004) Anker Api Error: Failed to request. Response Text: {"code":10004,"msg":"Failed to request.","trace_id":"4f311ef1dd9dff7f8e9241f6ba284f5f"} Exporting OTA update info for device... Saved JSON to file /Users/sl/PycharmProjects/anker-solix-api/./exports/ste20240729190900/ota_update_X9K0XWK8P04DRHR9.json Exporting device attributes...
I just tried to find the change in the code but didn't found it. Which commit do you refer to?

krostysun.zip
in the app a OTA Update is available
in the ota files the request is failed.
anything i can, test ?
My linux skills are not the best, but i will try my what i can.

@Krosty0712 the OTA requests do not work for the SB2 and smartmeter, don't know why. For SB1 they are also not reliably showing an available OTA update.
I have no clue how to query that and what would be valid versions, don't think this is provided via the cloud api.
What you can test with your setup are new information that can be queried via Api. See #107

Please provide your solarbank 2 system export examples here. You can extract all data with the system_export tool and zip the output files.

Where can I find the "system_export" tool? I do have an Anker Solix2 E1600 System and could provide information requested
Thx

@amor20git
Standard SB2 exports are not longer required if you do not have unsupported devices or settings in your system,
Please refer to following required exports:

#124 Support for smartplugs and settings to Smart Plug usage mode
Exports of systems with Shelly 3EM (Pro) smart meters

Beside the exports for smart plugs, the community has to provide more Api Endpoint testing with the smart plugs to see whether they can also be controlled via Api (Switch on / off, change their schedule, basically anything what is possible via App needs to be evaluated via Api endpoints as well).
It is also questionable and unknown, what the #107 device_attrs endpoints can be used for?
They have been implemented with SB2 support. I haven't found any attribute name yet that provides any data with SB1, but maybe that is working only with SB2, Smart Meter or Smart plugs which I cannot test.

Here is the export of a system with:

4 Anker SOLIX FS20 Flexible Solar Panels
1 Anker SOLIX Solarbank 2 E1600 Plus
1 Anker SOLIX Smart Plug

robxxx.zip

This is an export of a system with the following components:

Solarbank E1600 Pro without an extra battery pack
Anker Solix Smart Plug under load with a schedule set to turn off at 21:24 every day but Monday
Anker Solix Smart Plug under load with a delayed switch set to turn off after about 2 hours
nkr.zip

This is an export of a system with the following components:
* Solarbank E1600 Pro without an extra battery pack

* Anker Solix Smart Plug under load with a schedule set to turn off at 21:24 every day but Monday

* Anker Solix Smart Plug under load with a delayed switch set to turn off after about 2 hours
  [nkr.zip](https://github.com/user-attachments/files/17465559/nkr.zip)

That contains some interesting new data with the latest export module:

The ota_batch query really seems to list all firmware levels including sub components and whether new update is available. It will be helpful to provide a new export with that response once there is really an update available for the SB2 and/or smart meter/ or smart plugs. Hopefully the new version will be listed as well, so this could be extracted for the HA integration as well. That also means I can remove the other OTA queries again since they do not work most of the time...
The device_parm_6 response contains not only a custom rate plan (SB2 schedule), but also a blend_plan which was always null so far. Both are whole day, every day of the week, but rate plan shows 50 W while blend plan shows 20 W. Is that schedule with 20 W something you configured in the App and what is the blend_plan used for?

"param_data": "{\"mode_type\":2,\"custom_rate_plan\":[{\"index\":0,\"week\":[0,1,2,3,4,5,6],\"ranges\":[{\"start_time\":\"00:00\",\"end_time\":\"24:00\",\"power\":50}]}],\"blend_plan\":[{\"index\":0,\"week\":[0,1,2,3,4,5,6],\"ranges\":[{\"start_time\":\"00:00\",\"end_time\":\"24:00\",\"power\":20}]}],\"default_home_load\":200,\"max_load\":800,\"min_load\":0,\"step\":10}"

I can see power values for both plugs which is good. The same for energy of the plugs. It seems the smart plug data can then be added properly to the Api structures.
What I'm still missing are responses showing the smart plug setting, the delayed switch setting and the schedule. You will need to explore some Api queries whether you can find the proper endpoints/parameters to get those from the cloud as well.

The blend plan must be what the Anker app calls "Smart Plug Mode". As you had suggested in a previous post, I had set a base load of 20W for that mode that was active on all days of the week from 0:00 to 24:00. That's what we see in the data. What the solarbank then does is to always supply those 20W plus whatever is consumed according to the smart plugs.

So you are saying that you have 2 different schedules in the App?

One schedule for the Manual Usage mode
A different schedule for the Smart Plug mode
My understanding was there is only one schedule, and the system will use that schedule and add the power of the plugs.
If there are indeed 2 schedules, more work is required to support the smart plug mode since that would require to modify the blend plan structure instead of the custom_rate_plan structure.
Can you confirm that you really can manage 2 different schedules in the App when switching between Manual mode and Smart Plug mode?

Indeed, it's exactly as you say. I have one schedule set for the manual mode and one for the smart plug mode and I can switch between the two.

Oh dear.....Anker comes always up with new structures....I have no clue how to implement handling of multiple schedules for a device, because so many values/entities are derived from the schedule and now it must be distinguished which is the active schedule....
On the other hand, it is not sufficient for HA to handle only the active schedule, but the services must be able to manage both, the active and inactive one. Maybe this can be done with an additional service selection field for which schedule the service should be applied.....
But all entities will only work against the active schedule and selection of usage mode will also switch the active schedule...


testing a slightly different MySQL config

https://github.blog/changelog/2020-02-21-github-actions-breaking-change-ubuntu-virtual-environments-will-no-longer-start-the-mysql-service-automatically/


[LEGACY] feat: MR series stack sorting

Hi there. This is my first PR! :tada:
I hope I'm not doing anything wrong. This is a proposal for a slight modification of the stack sorting functions. I use it to work on liver MR and thought it would be cool to have this feature out-of-the-box. I took the liberty of modifying the code in-line. I'll let you judge if this feature needs its own separate file. My skills are limited for this and I appreciate your help.
Overall purpose of this PR
To implement stack sorting in the case of multiple MR sequences or phases bundled in the same series.
Description of the problem
In affected series, similar yet different MR sequences (different timing or acquisition parameters) are bundled together resulting in a "flickering" effect as all phases are viewed as one.
An example might be useful at this stage: https://viewer.ohif.org/viewer/2.25.63009447009646876712620988718732709379
All three series in this exam are affected by the problem :

in diffusion series, there is three different sequences with different B values
in the T1 sequence, three different timed acquisitions are mixed together

Can you see it?
Modalities affected by the problem
MR exams (possibly a good number of those). I only encountered it in liver MR.
The problem may arise in:

diffusion series in which the diffusion factor (B) is changed;
timed acquisition of T1 sequences with contrasting agent (phases).

Other modalities might be affected (CT, PT).
Why is this important to fix?
Series affected by this are flat-out unusable without a great deal of eye squinting. Diffusion series and timed acquisition with contrast are super important for diagnosing liver tumors (for investigational purposes of course :stuck_out_tongue_winking_eye:). Without a fix, we need another viewer to correctly interpret the exam.
How other viewers fix it
I won't cite any names here as I don't remember the particulars. Some split these series into as many stacks as there are phases. Some others just sort them and let you scroll one phase after another.
These changes are made either automatically or to the end-user's input, depending on the viewer.
Proposed solution
The most simple of those solutions would be sorting the series without splitting the stacks, because:

this is the first one I tried and managed to get working
we would need (would we?) to give appropriate names to the new stacks
there is already a sorting function built into OHIF ^_^

There isn't much code needed to implement this feature. It works like this :

An MR modality is requested (imageSet.modality)
All MR series are sorted by TemporalPositionIdentifier
Tag _instance.DiffusionBValue is checked: if not undefined, this is possibly a diffusion series and needs sorting according to this tag.

To be able to do this, we just need to request those tags when retrieving series metadata.
You can see it working here:
https://deploy-preview-1066--ohif.netlify.com/pwa/viewer/2.25.63009447009646876712620988718732709379 :smile:
Liver MR specifics
Liver MR exams are subject to substantial changes in acquisition techniques based on machine used, centre, and dare I say fashion trends in the radiology world :smile:.
Hence liver MR are often made of a butt-load of different series with new/unknown naming conventions. Affected series are fortunately somewhat predictable (diffusion/T1 with contrast) but we may encounter now or in the future the occasional odd one that has this problem. This is why I'm suggesting using this on every MR series.
I hope this helps in understanding the reasoning behind this PR. I'm eagerly awaiting your comments.
Cheers,
Al

First and foremost, thanks for the PR and for the amazing write-up ^_^
Second, and this is mostly for any reviewers, the E2E CI tests are failing, but it looks like the failures are caused by an assumption of MR slice ordering in the stack. These will likely need to be updated to work with the new ordering if/when we approve these changes.
While this is the easier implementation, as the end user, would you prefer that the stacks be split?
@swederik, do you have a preference on sort versus split? To codify this a bit, should we back these with some simple unit tests?

While this is the easier implementation, as the end user, would you prefer that the stacks be split?

I don't have a personal preference, but:

in favor of splitting stacks:

it avoids unintentional skipping of a whole series (the end user would only scroll through the first phase and think this is it)
it avoids bad window levels especially in diffusion series as the images get darker with high DiffusionBValues (see example)

in favor of sorting :

it avoids over-crowding MR exams that already have too many series
I can do it :sweat_smile:

Either way I'll be happy!
Cheers
Al

@alcheb very cool PR!
I would like to just add that most times the diffusion b-value tag are vendor specific in which only Philips fills the corresponding tag for the b-value.
Here are the tags normally used by Philips, GE and Siemens:
Siemens = (0018, 0024) or (0019; 100C)
GE = (0043, 1039)
Philips = (0018, 9087)
As for Philips, sometimes the files might be exported in enhanced DICOM leading to this tag to be
included within (5200, 9230) -> (0018, 9117)
Regarding the viewing of 4D series, Horos and OsiriX do something very interesting which is to load them as 4D series, where you will scroll through a 3D volume (e.g. b=0 or time = 0) and by using the up or down arrows you change to another b-value or time point 3D volume.
Hope this helps.

This is an important topic - thanks for contributing! 👍
There's a great set of testing data on this page:
https://www.nitrc.org/plugins/mwiki/index.php/dcm2nii:MainPage#Diffusion_Tensor_Imaging
Would be good to know how this sorting methodology works with the various datasets.

@alcheb very cool PR!

Thanks! :call_me_hand:

Regarding the viewing of 4D series, Horos and OsiriX do something very interesting which is to load them as 4D series, where you will scroll through a 3D volume (e.g. b=0 or time = 0) and by using the up or down arrows you change to another b-value or time point 3D volume.

Yes! Totally forgot about that. I've seen it as well in Telemis. There were numbers at the bottom indicating which stack you were viewing. Moving from stack to stack in the same series was done with left and right arrows or sliding left or right with the mouse. Thank you for putting a name on those things! :smile:
With all that said I reworked a bit the PR (commit to follow). This proposal has better scalability and the sorting is done separately giving the opportunity to develop at some later time a splitting version or a "multi-stack-series-scrolling" scheme as in Horos/OsiriX/Telemis.
The code is I hope sufficiently commented for a quick understanding of what's going on. There is some monitoring-specific code that outputs to the console.
We will need to extensively test this against sample exams. I have some other MR images Siemens that I'll anonymize and upload when I find the time.
Thank you @JoaoSantinha @pieper !
Cheers,
Al

Regarding the viewing of 4D series, Horos and OsiriX do something very interesting which is to load them as 4D series, where you will scroll through a 3D volume (e.g. b=0 or time = 0) and by using the up or down arrows you change to another b-value or time point 3D volume.

Yes! Totally forgot about that. I've seen it as well in Telemis. There were numbers at the bottom indicating which stack you were viewing. Moving from stack to stack in the same series was done with left and right arrows or sliding left or right with the mouse.

This is definitely something we want to add!
Some other things to think about:

How do we prefetch for a stack of stacks in Cornerstone? Across time (or 4th dimension) first, then within the stack? We will need a new prefetch strategy for this.
What do we do for the VTK extension? Build multiple volumes and swap them out for 4d? This could become very memory intensive. Maybe we should prevent reconstruction of 4d stacks for now for VTK?

Hi! I cleaned up some redundancies in the code. No need to have 2 indentical tag lists in two separate files.
Others things I did :

limited the number of stacks within a series to 4 (arbitrarily). The AcquisitionTime tag was causing some problems on a prostate MR with 19 different values ; now, if there are 5 or more unique values in the series the tag tested will be ignored ;
added some information in the series description about tags used in case of sorting ;
tested this with the DTI DICOM files provided by @pieper : brain MR exams, no problems with sorting ; some series are very very large (more than 2000 images!) ;
tested Siemens and GE-made liver MR with no problems (will upload them shortly).

Some other things to think about:

How do we prefetch for a stack of stacks in Cornerstone? Across time (or 4th dimension) first, then within the stack? We will need a new prefetch strategy for this.
What do we do for the VTK extension? Build multiple volumes and swap them out for 4d? This could become very memory intensive. Maybe we should prevent reconstruction of 4d stacks for now for VTK?

I wrote a quick override to consider all 4D series as non reconstructable for the time being.
Sadly I think I am unable to go much further than that. Any tinkering with cornerstone, viewports and overlay elements in order to implement a true multi-stack series scrolling will have to be done by someone else! :sweat_smile:
Cheers
Al

@alcheb are you able to action @swederik's suggested changes, or do you require assistance?

@swederik would you like me to assign a Core Team developer to carry this across the finish line?

Don't close it. We want / need this functionality it just keeps getting pushed down my list.

I'm closing this as not planned because it's related to v2-legacy. Keeping it open might suggest we support fixing issues in v2-legacy. If this problem persists in v3, please open an issue or, even better, provide a fix for v3.


text input gets confused?

https://github.com/aprilmintacpineda/preact-test-app/tree/0.0.1
The project was created with preact create default test-app. On the home page, there's an input of type=text with value={this.state.newTodo}. Try to type as fast as you can, maybe just type asd over and over again and watch the console. You'll observe that it get's confused, you can say that because of the output, you'll see that some stuff get's on the console twice, which can't be because you are literally typing asdasdasdasdasdasdas.

Preact uses default browser events.
In your example you are listening on the keyup event.
The keyup event will in some cases not get fired before an other keystroke occurs and therefore the inputs value property is updated.
You can oberserve this behavior within your logs for example from log line 3 to log line 4 the value changes from asd to asdas.

@aprilmintacpineda The repo that you linked doesn't print out the inputs content at all. Preact uses the standard browser event system. If you feel like they don't follow the spec, the browsers bug tracker are the right place to file an issue for that.
Looking at the other issue you just closed #1141 it looks like the term you are looking for is controlled vs uncontrolled form inputs. The react docs have a great section about the differences.


Release v1.2.4

Merge all PRs and release v1.2.4 on GitHub and npm

Just a comment, we are not prefixing versions with v.


browsersync should default to HTTPS, fixes #19

Fixes

#19

Currently, browsersync is configured to run on the HTTP. This is not optimal.
This PR changes browsersync to use the HTTPS protocal instead.
Note: When starting browsersync, it reports the "External URL" has HTTP.  I tried adding HTTPS: true to the config file but this resulted in a broken DDEV (502)

Does this mean you figured it out, or that you still couldn't make it work on https?

This is working locally for me.

Browsersync is running on HTTPS protocal in the browser. The CLI reports to running on HTTP though. It would be nice to have that correct but I think it might be the reverse  proxy stuff?

Looks like maybe some work remaining to do on tests?

I did the changes to expose the new ports in docker-compose.browsersync.yaml. Here are the test results for different scenarios.
1 - Opening https://browsersync.ddev.site:3000 in the browser. As you may see any changes in the index.html file are loaded in the browser window.

2 - By opening http://browsersync.ddev.site:3000 in the browser (the BrowserSync External link) we get a 400 error.

3 - By opening http://browsersync.ddev.site in the browser (the DDEV link using HTTP protocol) BrowserSync detects the changes in the file but it is not reloading the browser window content.

In order to display https instead of http in the External link of the BrowserSync console we should add this option https: true in the browser-sync.js file, but if we do this you may see what happens bellow. BrowserSync detects the changes in the index.html file, but accessing the External link in the browser produces a 502 error.

As a first conclusion after these scenarios. Changing the ports was beneficial, now the addon can also be used with HTTPS. The issue that needs to be solved is related to the External link displayed by BrowserSync in the console and which creates confusion but also errors in the situation in which it is used.

Not sure why the tests are failing :(

FYI it's worth thinking about allowing HTTPS communication between ddev-webserver and ddev-router, but that wouldn't fundamentally solve the problem here, because the bound port (443) by default might be changed.
Thanks for all the work on this.

This PR can be tested with ddev get https://github.com/tyler36/ddev-browsersync/tarball/tyler36/https-support/

I got the PR and encountered no issues so far

Doggone those tests :)

Will definitely review and take a look at tests. Just under the gun to get the traefik stuff done for a major release. Thanks for your patience!

Closing this in favor of #31

Sorry. #31 was a PR to this PR. Re-opening.


what is itemSkus? package name or product id?

Version of react-native-iap
latest
Version of react-native
0.56
Platforms you faced the error (IOS or Android or both?)
Android
Expected behavior
it should return products defined in play console
Actual behavior
getProducts empty array
Tested environment (Emulator? Real Device?)
Real Device
Question
RNIap.getProducts(itemSkus) -> what to give in itemSkus? its package name or product id defined in in-app products?
here is my test products i have created and i have published an app so all products are active.

got it, its product id.
there are default product id's provided android.test.purchased, android.test.canceled, android.test.item_unavailable
so if you update your readme for the same then it would be great for other users to quickly integrate.
Thanks


⚠ Thumbnails API Endpoint has degraded performance

In 8035784, Thumbnails API Endpoint (https://thumbnails.roblox.com/v1/assets?assetIds=82738847&format=Png&isCircular=false&size=30x30) experienced degraded performance:

HTTP code: 503
Response time: 5680 ms

Resolved: Thumbnails API Endpoint performance has improved in 609363b after 28 minutes.


Fix triggers for unit tests

Unit tests are currently run twice for pull requests. We should fix the triggers of the GitHub Action

When you say "run twice", do you mean they run when a PR is submitted and when the PR is merged into the main branch?


License notices etc redo

Hey, @giang271291.  This is a redo of my pull request #1, this time against the revised base commit.  I see now that you also had redone the PR (in #5), but better to merge this one (#6) to preserve the author audit trail.

Thanks @kfogel, we will merge this PR now


[dubbo-1689]: Enhance the test coverage part-10 : dubbo-plugin module

What is the purpose of the change
issue#1689: Enhance the test coverage part-10 : dubbo-plugin module
Brief changelog
dubbo-plugin/dubbo-qos/src/main/java/org/apache/dubbo/qos/protocol/QosProtocolWrapper.java
dubbo-plugin/dubbo-qos/src/main/java/org/apache/dubbo/qos/server/Server.java
dubbo-plugin/dubbo-qos/src/test/java/org/apache/dubbo/qos/protocol/QosProtocolWrapperTest.java
Verifying this change
Follow this checklist to help us incorporate your contribution quickly and easily:

[x] Make sure there is a GITHUB_issue filed for the change (usually before you start working on it). Trivial changes like typos do not require a GITHUB issue. Your pull request should address just this issue, without pulling in other changes - one PR resolves one issue.
[ ] Format the pull request title like [Dubbo-XXX] Fix UnknownException when host config not exist #XXX. Each commit in the pull request should have a meaningful subject line and body.
[ ] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
[ ] Write necessary unit-test to verify your logic correction, more mock a little better when cross module dependency exist. If the new feature or significant change is committed, please remember to add integration-test in test module.
[ ] Run mvn clean install -DskipTests & mvn clean test-compile failsafe:integration-test to make sure unit-test and integration-test pass.
[ ] If this contribution is large, please follow the Software Donation Guide.

Codecov Report

Merging #1982 into master will increase coverage by 0.2%.
The diff coverage is 37.5%.

@@            Coverage Diff             @@
##             master   #1982     +/-   ##
==========================================
+ Coverage      50.6%   50.8%   +0.2%
- Complexity     4745    4763     +18
==========================================
  Files           562     562
  Lines         25213   25218      +5
  Branches       4449    4449
==========================================
+ Hits          12758   12811     +53
+ Misses        10524   10470     -54
- Partials       1931    1937      +6

Impacted Files
Coverage Δ
Complexity Δ

.../apache/dubbo/qos/protocol/QosProtocolWrapper.java
54.28% <20%> (+54.28%)
6 <0> (+6)
:arrow_up:

.../main/java/org/apache/dubbo/qos/server/Server.java
72.09% <66.66%> (+72.09%)
10 <2> (+10)
:arrow_up:

.../dubbo/remoting/transport/netty4/NettyChannel.java
60% <0%> (-5%)
21% <0%> (-1%)

...e/dubbo/remoting/transport/netty4/NettyServer.java
72.13% <0%> (-3.28%)
9% <0%> (-1%)

...he/dubbo/registry/multicast/MulticastRegistry.java
57.74% <0%> (+1.67%)
41% <0%> (+3%)
:arrow_up:

...ubbo/rpc/protocol/dubbo/ChannelWrappedInvoker.java
50% <0%> (+8.33%)
3% <0%> (ø)
:arrow_down:

...in/java/org/apache/dubbo/qos/server/DubboLogo.java
50% <0%> (+50%)
1% <0%> (+1%)
:arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f186f2b...9159be2. Read the comment docs.


installing to ~/.homebrew (or anywhere) should be 100% supported as a goal

I've always installed homebrew in a custom location and I don't remember running into issues because of that (obviously I haven't installed all packages however).
The docs however recommend against it: https://github.com/Homebrew/brew/blob/master/share/doc/homebrew/Installation.md
but without showing evidence as to when things can break because of that.
Eg: http://superuser.com/a/1025497/295075 shows:

I can confirm that several packages worked (seqtk, pear) while others failed (wget, homebrew/science/blast, jags). I am also unable to change the ownership of my /usr/local directory, so I'm back to compiling those packages manually

However I just tried, and those packages seem to install just fine on non-standard homebrew location.
I think we should:

at very least try to support installing to elsewhere than /usr/local/ and remove the paragraph in docs that says it's dangerous
specifically track bugs related to this issue should they arise
(stretch goal) make ~/.homebrew the new default instead of /usr/local (linuxbrew got this right with ~/.linuxbrew)

Rationale:

concurrent homebrew installs, eg to try out packages without breaking everything that relies on homebrew installed packages. By definition, it's impossible when only /usr/local is supported
/usr/local actually can interfere with other packages installed on mac, eg when user does make && make install it'll install there. Seperating out what's from homebrew vs not in that folder can be a pain, if not impossible when some files are overwritten (eg: http://blog.mact.me/2015/05/15/so-you-want-to-move-your-homebrew-folder)
/usr/local often require special privileges (eg http://superuser.com/questions/986338/change-install-location-and-prefix-of-homebrew-packages)
linuxbrew does this successfully (and as a default)

Disclaimer. I only speak for myself and the reply does not reflect the opinions of the Homebrew team.

I've always installed homebrew in a custom location and I don't remember running into issues because of that

Good for you.

at very least try to support installing to elsewhere than /usr/local/ and remove the paragraph in docs that says it's dangerous

We do "support" it, there's practically nothing in your way, but it is dangerous because it untested by us and most of our users. I don't see this warning removed any time soon.
I'm probably not in the position to say this, but testing anything other than /usr/local requires extra code, extra manpower, extra CI infrastructure, and extra _ (fill in blank here). I don't think it's feasible, at least not at the moment.

specifically track bugs related to this issue should they arise

You can report them. We'll try to squash bugs if we can, of course.

make ~/.homebrew the new default instead of /usr/local (linuxbrew got this right with ~/.linuxbrew)

I don't see this happening. Linuxbrew didn't get it right, it's just an unfortunate workaround on multiuser systems for users who are not sudoers and who cannot (or don't bother to) convince their sysadmins to install the software they need. Having a gigantic ~/.linuxbrew in every user's home is ridiculous, and sysadmins hate it.
By the way, this is very very clearly rejected in https://github.com/Homebrew/brew-evolution/blob/master/commonly_rejected_proposals.md.

concurrent homebrew installs

That's possible today. I do it, many maintainers do it. Just don't expect bottles in many/most cases, and don't expect official support (but let me repeat myself, we do try to help when we can).

/usr/local actually can interfere with other packages installed on mac, eg when user does make && make install it'll install there.

Pick a different prefix ahead of time when you install random things (and keep in mind that they can still write to wherever they want even if you tell them to write to a certain prefix — which is why we enabled sandboxing). You don't complain about apt, rpm or yum installing to /usr because they own /usr. We can't own /usr, so we instead own /usr/local. This stuff is all in FAQ. If you disagree, you should probably choose a different package manager, like MacPorts.

/usr/local often require special privileges

Install to somewhere else then. Again, it's been possible for a long time.

Overall, we're a very small team, and we have enough things on our hands already, so sorry. What you're proposing here is a gazillion times easier said than done. Not saying it's impossible to happen at some point in the future, but don't anticipate it.

Hey @zmwangx, be nice.
Generally, what zmwangx said. We do support Homebrew in other locations (and are actually working on making that more flexible), but for technical reasons and resource limitations, getting that to "100% support" is infeasible.
The core code is written to support "prefixes" at arbitrary locations. I and other maintainers do run Homebrew at non-default installation locations. And your rationale makes sense, especially for concurrent Homebrew installs.
If you run in to bugs when running Homebrew at a non-default location, go ahead and report them. They will be tracked and handled as first-class bugs (though some might be un-fixable).
But there's no way we can get the quality of installations at non-default locations to the same level as the default location. That's what's actually tested in our testing infrastructure, and is used by probably the vast majority of our users, so it has a lot more eyes on it. (And some packages have dependencies specifically on /usr/local, unfortunately. We try to eliminate those when we find them.)
Conservative users who want to minimize their risk of breakage, or who want to maximize the benefit of bottles, will want to stick with the default installation location. And we want to make that clear in our documentation. So I think the warning will remain.
I wouldn't recommend installing under a user's home directory by default. Homebrew on OS X expects and intends to be a system-level package manager.
Overall: We basically want what you want, it's mostly supported, but we can't get 100% there, and want to make that very clear to users who might care.

(stretch goal) make ~/.homebrew the new default instead of /usr/local (linuxbrew got this right with ~/.linuxbrew)

This is impossible for Homebrew if we want to continue to distribute binary packages. ~/.homebrew is not a path; it expands to /Users/mike/.homebrew for me and something else for you. As a result, any binary packages that hard-code locations inside them (rather a lot, unfortunately) need a hard-coded location.

/usr/local actually can interfere with other packages installed on mac, eg when user does make && make install it'll install there. Seperating out what's from homebrew vs not in that folder can be a pain, if not impossible when some files are overwritten (eg: http://blog.mact.me/2015/05/15/so-you-want-to-move-your-homebrew-folder)

This blog post is inaccurate if you use the current installer: https://github.com/homebrew/install
The new default location is /usr/local/Homebrew for the Homebrew repository (e.g. the source code, taps, README.md, etc.and/usr/localfor the Homebrew prefix (e.g. where the symlinks are made, where theCellaris). People with a/usr/local` prefix will be migrated to this format as-of https://github.com/Homebrew/brew/pull/963.

/usr/local often require special privileges (eg http://superuser.com/questions/986338/change-install-location-and-prefix-of-homebrew-packages)

Again, as-of https://github.com/Homebrew/brew/pull/963 and the current installer at https://github.com/homebrew/install you no longer need to take ownership of /usr/local but instead just various top-level directories in /usr/local.

I don't want to blindly install packages all over my laptop with super user privileges. brew should have a easy way of specifying prefixes when installing other packages. While it is true this may break some packages , as it is already pointed out. However for some users like myself who are security conscious and understand the big risk of downloading third party packages from every corner of the world and installing it with superuser privilege in your mac laptop , having an option of installing locally or in ones home directory is just common sense.


Begin/End ServiceDelivery to return correct response.

Currently the Begin/End ServiceDelivery functions of the SDK return a ServiceDeliveryToken.
According to the spec this is incorrect - they should be returning the appropriate:

BeginServiceDeliveryResponse
EndServiceDeliveryResponse

These objects actually contain the ServiceDeliveryToken but also other valuable pieces of information for service handover.

@chackett is this still relevant?

Let's park it for the moment.. I need to rethink.

Okay am I misreading this:
BeginServiceDeliveryResponse provides additionally the number_of_units_to_be_supplied
delivery_end_response provides additionally the number_of_units_just_supplied, and number_of_units_remaining
As I see it the beginServiceDelivery passes the delivery token and a requested number of units to supply. The End service delivery then passes the token and the number of units received.
Isn't this essentially doing what is described above and therefore this can be closed?


Huffman codec can serialize to text

Refactored the Huffman codec implementation and added ability to
serialize to C++-like text format. This would reduce the time-complexity
if loading hard-coded codecs.

Rebased and pushed into master as 17d941af4f


Patch 3

Update relative to absolute Path Formatting

I only tested the running of the 2 new ps scripts.  The test was fine!


astroid: folders for drafts and sent are set as relative paths, but astroid expects full paths

In the astroid module, the value for save_sent_to is simply taken from accounts.email.accounts."name".folders.sent
https://github.com/rycee/home-manager/blob/e68d6e7924925b28ddd46bd7748be7aa3e5c57bd/modules/programs/astroid.nix#L17-L27
According to astroid's configuration documentation an absolute Path is required (and also sync behaviour can be controlled by putting mail into different mailbox subfolders?):

accounts.[accountname].save_sent_to
Type    : directory-path
Default : /home/root/Mail/sent/cur/

But in email.nix, the folders.* options are supposed to be relative paths inside the mailbox:
https://github.com/rycee/home-manager/blob/e68d6e7924925b28ddd46bd7748be7aa3e5c57bd/modules/accounts/email.nix#L255-L261
The accounts.[accountname].save_drafts_to setting has the same problems.
I'm just switching to these kinds of mail setups, so I might just be missing something obvious.
Thank you,
Alex

Perhaps it would suffice to have
[...]
+    save_drafts_to = "${maildir.absPath}/${folders.drafts}";
[...]
+    save_sent_to = "${maildir.absPath}/${folders.sent}";
[...]

?

No, it won't, if you want to use the maildir correctly: You have to place the files in /new.
So the folders become:
{
save_drafts_to = "${maildir.absPath}/${folders.drafts}/new";
save_sent_to = "${maildir.absPath}/${folders.sent}/new";
}

. See also save_sent_to and save_drafts_to in the the astroid config reference.
To my understanding, these mails are really newly injected into the Maildir, hence must go to the 'new' subfolder.

I was trying to fix this but am currently blocked by https://github.com/rycee/home-manager/issues/747

Where's the connection?
Do I understand correctly, that you see it in multiple mbsync channels per account for renaming sent/draft folders? But if rycee's and my solution are sufficient, which I assume, this issue requires merely a change local to the astroid config. So mbsync mechanics for folders needn't be touched in any way, if the options maildir.absPath and folders.(drafts|sent) stay there and don't change meaning.
Or maybe you see an entanglement with mbsync in the /cur/-question (see above)? If I understand the hint

Note that here the end does not contain /cur/ which in many cases has the effect that programs like mbsync will not sync your draft messages back to an IMAP server for example.
-- @wirew0rm in previous comment

correctly, then this is a totally reasonable behavior: Inside a Maildir, messages reside in /cur/, new or tmp. Files somewhere else are noise with unspecified behaviour. It's only consequent to not sync theese, but only regular Maildir messages. So it is no problem at all. The only issue I have with /cur/ is what I posted above: It should be /new/. And mbsync syncs this.


squid:S1118 - Utility classes should not have public constructors

This pull request is focused on resolving occurrences of Sonar rule
squid:S1118 - Utility classes should not have public constructors.
This pull request removes technical debt of 510 minutes.
You can find more information about the issue here:
https://dev.eclipse.org/sonar/rules/show/squid:S1118
Please let me know if you have any questions.
George Kankava

OK to merge @TomasKypta

@davidvavra Are we merging this pull request?

@georgekankava I don't have the write access to this repo, @TomasKypta has to do it.

@davidvavra @TomasKypta Thanks for merging.


Remove version: RoyQu.RedPanda-C++ version 3.0

[Automated] It returns code over 400 in all urls
Microsoft Reviewers: Open in CodeFlow

URL: https://sourceforge.net/projects/redpanda-cpp/files/v3.0/RedPanda.C++.3.0.win32.MinGW32_8.1.Setup.exe/download
OK
(Automated message - build 923)

Close with reason: Duplicate;


While copying teams notes some css also copied

Steps to reproduce
While copying Teams notes, some CSS code was also inadvertently copied along with the text. This unintended action may lead to unexpected formatting or display issues when pasting the content into another document or platform.
Expected behavior
CSS should not copied while coping the notes
Actual behavior
CSS is copied while coping the notes
Error details
No response

Based on the description it looks like your issue is not related to Teams app development. We will add appropriate tags so the respective team will look into it. Thank you.

I think while pasting only this issue is happening inside teams only. If we paste on Notepad then text is ok.
but in teams here is extra text or styling
ol  {margin-bottom:0in;margin-top:0in;}ul {margin-bottom:0in;margin-top:0in;}li {margin-top:.0in;margin-bottom:8pt;}ol.scriptor-listCounterResetlist!list-5e81b844-856b-4231-b679-3c6b927403011 {counter-reset: section;}ol.scriptor-listCounterlist!list-5e81b844-856b-4231-b679-3c6b927403011 {list-style-type:bullet;}li.listItemlist!list-5e81b844-856b-4231-b679-3c6b927403011::before {counter-increment: section;content: none; display: inline-block;}

For Microsoft Teams product issues/failures your tenant Admin can reach out to Microsoft 365 Product Support.
For general questions about Microsoft Teams please post your question on Microsoft Teams Community.


Detect right/left swipe on vertical pager

Hi,
If I use this in vertical mode, is there I way I could detect rigt/left swipe events?
Thank you!

Hi cristin,
I use the addOnPageChangedListener method:
pager.addOnPageChangedListener(new RecyclerViewPager.OnPageChangedListener() {
@Override
public void OnPageChanged(int i, int currentIndex) {
//currentIndex changes as you swipe
}
});`

@silentlion
doesn't call OnPageChangedListener sometimes,why?


All types should be assignable to Type.Any

Report a bug
🔎 Search Terms
🧩 Context

ArkType version: 2.0.0-rc.5
TypeScript version (5.1+): 5.5.4
Other context you think may be relevant (JS flavor, OS, etc.):

🧑💻 Repro
const m = <t extends Type.Any>(type: t): t => type;
const a = type("string").pipe((s) => s);
const t = m(a);

Produces error:
Argument of type 'Type<(In: string) => Out<string>, {}>' is not assignable to parameter of type 'Any<any>'.
  Types of property 'out' are incompatible.
    Type 'Type<unknown, {}>' is missing the following properties from type 'Type<any, any>': matching, atLeastLength, atMostLength, moreThanLength, and 2 more.ts(2345)

Simplified:
const tt: Type.Any = {} as Type<(In: string) => Out<string>, {}>

Produces:
Type 'Type<(In: string) => Out<string>, {}>' is not assignable to type 'Any<any>'.
  Types of property 'out' are incompatible.
    Type 'Type<unknown, {}>' is not assignable to type 'Type<any, any>'

This is fixed in 2.0.0-rc8. Type.Any has also been renamed to type.Any to align with other utilities available on the type.

This update is now breaking a lot of other stuff for us:
Found 54 errors in 33 files.

So I'm unable to test the fix

Everything is working as expected